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;
138 return !str.empty() &&
145 (str[0] ==
'/' || str[0] ==
'\\')
150 (str.length() > 2 && str[1] ==
':')
151 && (str[2] ==
'/' || str[2] ==
'\\')
166 return isBackup(*
this);
172 return contains(
'/');
178 const auto i = str.rfind(
'/');
180 if (i == std::string::npos)
186 return str.substr(0, i);
201 const auto i = str.rfind(
'/');
203 if (i == std::string::npos)
208 return str.substr(i+1);
247 const auto i = find_ext();
249 if (i == std::string::npos)
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
word stem() const
Return basename, without extension.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName & replace_ext(const word &ending)
Remove extension (if any) and append a new one.
word ext() const
Return file name extension (part after last .)
bool has_path() const
True if it contains a '/' character.
fileName()=default
Default construct.
void stripInvalid()
Strip invalid characters.
bool isAbsolute() const
Return true if filename is absolute, which means it starts with a '/' or '\' or (windows-only) with a...
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
word name() const
Return basename (part beyond last /), including its extension.
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.
int debug
Static debugging option.
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".
const dimensionedScalar c
Speed of light in a vacuum.
bool isspace(char c) noexcept
Test for whitespace (C-locale)
fileName lessExt() const
Return file name without extension (part before last .)
fileName path() const
Return directory path name (part before last /)
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))
A class for handling character strings derived from std::string.
fileName & operator=(const fileName &str)
Copy assignment, no character validation required.
bool remove_ext()
Remove extension, return true if string changed.