Go to the documentation of this file.
108 && (!
isspace(
c) || (allowSpaceInFileName &&
c ==
' '))
116 if (
debug && string::stripInvalid<fileName>(*
this))
119 <<
"fileName::stripInvalid() called for invalid fileName "
125 <<
" For debug level (= " <<
debug
126 <<
") > 1 this is considered fatal" <<
std::endl;
140 (!str.empty() && str.front() ==
'/')
145 (str.length() > 2) &&
147 (str[1] ==
':' && str[2] ==
'/')
148 || (str[0] ==
'\\' && str[1] ==
'\\')
158 return isAbsolute(*
this);
164 return isBackup(*
this);
188 const auto i = str.rfind(
'/');
196 return str.substr(0, i);
211 const auto i = str.rfind(
'/');
218 return str.substr(i+1);
236 return nameLessExt(*
this);
242 const auto i = find_ext();
int debug
Static debugging option.
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
A class for handling words, derived from Foam::string.
A class for handling file names.
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))
bool removeExt()
Remove extension, returning true if string changed.
fileName path() const
Return directory path name (part before last /)
bool isAbsolute() const
Return true if file name is absolute (starts with a '/')
word nameLessExt() const
Return basename, without extension.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
A class for handling character strings derived from std::string.
static bool valid(char c)
Is this character valid for a fileName?
bool isBackup() const
Return true if file name ends with "~", ".bak", ".old", ".save".
word name() const
Return basename (part beyond last /), including its extension.
bool hasPath() const
Return true if it contains a '/' character.
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
word ext() const
Return file name extension (part after last .)
bool removeExt()
Remove extension, returning true if string changed.
bool hasPath() const
Return true if it contains a '/' character.
fileName()=default
Construct null.
word ext() const
Return file name extension (part after last .)
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool removePath()
Remove leading path, returning true if string changed.
void stripInvalid()
Strip invalid characters.
fileName & operator=(const fileName &str)
Copy assignment, no character validation required.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
const dimensionedScalar c
Speed of light in a vacuum.
void assign(Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op)
Populate a field as the result of a unary operation on an input.
bool isspace(char c)
Test for horizontal whitespace.
bool removePath()
Remove leading path, returning true if string changed.