48#ifndef Foam_fileName_H
49#define Foam_fileName_H
62template<
class T>
class List;
124 inline fileName(
const string&
s,
bool doStrip=
true);
127 inline fileName(
string&&
s,
bool doStrip=
true);
130 inline fileName(
const std::string&
s,
bool doStrip=
true);
133 inline fileName(std::string&&
s,
bool doStrip=
true);
136 inline fileName(
const char*
s,
bool doStrip=
true);
142 explicit fileName(std::initializer_list<word> list);
158 inline static bool valid(
char c);
171 const std::string& s1,
172 const std::string& s2,
173 const char delim =
'/'
178 static bool equals(
const std::string& s1,
const std::string& s2);
219 static bool clean(std::string& str);
234 Type type(
bool followLink=
true,
bool checkGzip=
false)
const;
238 inline static bool isAbsolute(
const std::string& str);
249 static bool isBackup(
const std::string& str);
273 inline static std::string
name(
const std::string& str);
280 static std::string
nameLessExt(
const std::string& str);
309 inline static std::string
path(
const std::string& str);
330 const bool caseTag =
false
417Istream&
operator>>(Istream& is, fileName& val);
427fileName
operator/(
const string& s1,
const string& s2);
433fileName
search(
const word& file,
const fileName& directory);
graph_traits< Graph >::vertices_size_type size_type
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void assign(const faPatch &fap)
Clear and populate with values from finiteArea patch.
A class for handling file names.
wordList components(const char delim='/') const
Return path components as wordList.
fileName relative(const fileName &parent, const bool caseTag=false) const
static fileName validate(const std::string &, const bool doClean=true)
bool assign(const token &tok)
Assign from word or string token.
bool clean()
Cleanup filename (inplace)
Type
Enumerations to handle directory entry types.
@ SYMLINK
A symbolic link.
@ UNDEFINED
Undefined type.
Type type(bool followLink=true, bool checkGzip=false) const
fileName()=default
Default construct.
fileName & operator/=(const string &other)
Append a path element with '/' separator.
word name() const
Return basename (part beyond last /), including its extension.
fileName(fileName &&)=default
Move construct.
static fileName concat(const std::string &s1, const std::string &s2, const char delim='/')
Join two strings with a path separator ('/' by default).
bool removePath()
Remove leading path, returning true if string changed.
bool hasPath() const
Return true if it contains a '/' character.
fileName & operator=(const fileName &str)
Copy assignment, no character validation required.
fileName lessExt() const
Return file name without extension (part before last .)
static bool equals(const std::string &s1, const std::string &s2)
word component(const size_type cmpt, const char delim='/') const
Return a single component of the path or empty if out of range.
static const fileName null
An empty fileName.
static bool valid(char c)
Is this character valid for a fileName?
word ext() const
Return file name extension (part after last .)
fileName & toAbsolute()
Convert from relative to absolute.
fileName path() const
Return directory path name (part before last /)
static int debug
Debugging.
fileName(const fileName &)=default
Copy construct.
void stripInvalid()
Strip invalid characters.
bool isBackup() const
Return true if file name ends with "~", ".bak", ".old", ".save".
static int allowSpaceInFileName
Allow space character in fileName. To be used with caution.
word nameLessExt() const
Return basename, without extension.
static const char *const typeName
The typeName.
A class for handling character strings derived from std::string.
bool removeExt()
Remove extension, returning true if string changed.
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< word > wordList
A List of words.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
Istream & operator>>(Istream &, directionInfo &)
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Hashing functor for string and derived string classes.