108 && (!
isspace(c) || (allowSpaceInFileName && c ==
' '))
116 if (debug && string::stripInvalid<fileName>(*
this))
119 <<
"fileName::stripInvalid() called for invalid fileName "
120 << this->c_str() << std::endl;
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] ==
'\\')
160 return isAbsolute(*
this);
166 return isBackup(*
this);
178 const auto i = str.rfind(
'/');
186 return str.substr(0, i);
201 const auto i = str.rfind(
'/');
208 return str.substr(i+1);
226 return nameLessExt(*
this);
232 const auto i = find_ext();
274 assign(std::move(str));
289 assign(std::move(str));
304 assign(std::move(str));
320 assign(std::move(str));
bool valid() const
True if all internal ids are non-negative.
A class for handling file names.
fileName()=default
Default construct.
word name() const
Return basename (part beyond last /), including its extension.
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 .)
word ext() const
Return file name extension (part after last .)
fileName path() const
Return directory path name (part before last /)
void stripInvalid()
Strip invalid characters.
bool isBackup() const
Return true if file name ends with "~", ".bak", ".old", ".save".
word nameLessExt() const
Return basename, without extension.
A class for handling character strings derived from std::string.
bool removePath()
Remove leading path, returning true if string changed.
bool hasPath() const
Return true if it contains a '/' character.
word ext() const
Return file name extension (part after last .)
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
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 isspace(char c) noexcept
Test for whitespace (C-locale)