A class for handling file names. More...
Public Types | |
enum | Type { UNDEFINED = 0, FILE = 1, DIRECTORY = 2, LINK = 4 } |
Public Member Functions | |
fileName ()=default | |
fileName (const fileName &)=default | |
fileName (fileName &&)=default | |
fileName (const word &s) | |
fileName (word &&s) | |
fileName (const string &s, bool doStrip=true) | |
fileName (string &&s, bool doStrip=true) | |
fileName (const std::string &s, bool doStrip=true) | |
fileName (std::string &&s, bool doStrip=true) | |
fileName (const char *s, bool doStrip=true) | |
fileName (const UList< word > &list) | |
fileName (std::initializer_list< word > list) | |
fileName (Istream &is) | |
bool | assign (const token &tok) |
void | stripInvalid () |
bool | clean () |
Type | type (bool followLink=true, bool checkGzip=false) const |
bool | isAbsolute () const |
fileName & | toAbsolute () |
bool | isBackup () const |
word | name () const |
word | nameLessExt () const |
word | name (const bool noExt) const |
fileName | path () const |
bool | hasPath () const |
bool | removePath () |
fileName | relative (const fileName &parent, const bool caseTag=false) const |
fileName | lessExt () const |
word | ext () const |
fileName & | ext (const word &ending) |
wordList | components (const char delim='/') const |
word | component (const size_type cmpt, const char delim='/') const |
fileName & | operator= (const fileName &str) |
fileName & | operator= (fileName &&str) |
fileName & | operator= (const word &str) |
fileName & | operator= (word &&str) |
fileName & | operator= (const string &str) |
fileName & | operator= (string &&str) |
fileName & | operator= (const std::string &str) |
fileName & | operator= (std::string &&str) |
fileName & | operator= (const char *str) |
fileName & | operator/= (const string &other) |
bool | hasExt () const |
bool | hasExt (const char *ending) const |
bool | hasExt (const std::string &ending) const |
bool | hasExt (const wordRe &ending) const |
bool | removeExt () |
![]() | |
string ()=default | |
string (const std::string &str) | |
string (std::string &&str) | |
string (const char *str) | |
string (const char *str, const size_type len) | |
string (const char c) | |
string (const size_type len, const char c) | |
string (Istream &is) | |
bool | match (const std::string &text) const |
string & | replace (const std::string &s1, const std::string &s2, size_type pos=0) |
string & | replaceAll (const std::string &s1, const std::string &s2, size_type pos=0) |
string & | replaceAny (const std::string &s1, const char c2, size_type pos=0) |
string & | expand (const bool allowEmpty=false) |
bool | removeRepeated (const char character) |
bool | removeStart (const std::string &text) |
bool | removeStart (const char c) |
bool | removeEnd (const std::string &text) |
bool | removeEnd (const char c) |
void | swap (std::string &str) |
bool | operator() (const std::string &text) const |
bool | starts_with (const std::string &s) const |
bool | starts_with (const char c) const |
bool | ends_with (const std::string &s) const |
bool | ends_with (const char c) const |
size_type | count (const char c) const |
bool | startsWith (const std::string &s) const |
bool | endsWith (const std::string &s) const |
bool | removeTrailing (const char c) |
Static Public Member Functions | |
static bool | valid (char c) |
static fileName | validate (const std::string &, const bool doClean=true) |
static fileName | concat (const std::string &s1, const std::string &s2, const char delim='/') |
static bool | equals (const std::string &s1, const std::string &s2) |
static bool | clean (std::string &str) |
static bool | isAbsolute (const std::string &str) |
static bool | isBackup (const std::string &str) |
static std::string | name (const std::string &str) |
static std::string | nameLessExt (const std::string &str) |
static std::string | path (const std::string &str) |
![]() | |
template<class StringType > | |
static bool | valid (const std::string &str) |
template<class StringType > | |
static bool | stripInvalid (std::string &str) |
template<class StringType > | |
static StringType | validate (const std::string &str) |
Static Public Attributes | |
static const char *const | typeName = "fileName" |
static int | debug |
static int | allowSpaceInFileName |
static const fileName | null |
![]() | |
static const char *const | typeName = "string" |
static int | debug |
static const string | null |
Additional Inherited Members | |
![]() | |
std::string::size_type | find_ext () const |
word | ext () const |
bool | ext (const word &ending) |
bool | hasPath () const |
bool | hasExt () const |
bool | hasExt (const char *ending) const |
bool | hasExt (const std::string &ending) const |
bool | hasExt (const wordRe &ending) const |
bool | removeExt () |
bool | removePath () |
![]() | |
static std::string::size_type | find_ext (const std::string &str) |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const char *fmt, const PrimitiveType &val) |
template<class PrimitiveType > | |
static std::string::size_type | string_printf (std::string &output, const std::string &fmt, const PrimitiveType &val) |
A class for handling file names.
A fileName is a string of characters without whitespace or quotes. A fileName can be
The string::expand() method expands environment variables, etc,
Definition at line 71 of file fileName.H.
enum Type |
Enumerator | |
---|---|
UNDEFINED | Undefined type. |
FILE | A file. |
DIRECTORY | A directory. |
LINK | A symlink. |
Definition at line 78 of file fileName.H.
|
default |
Definition at line 26 of file fileNameI.H.
Definition at line 32 of file fileNameI.H.
Definition at line 38 of file fileNameI.H.
References fileName::stripInvalid().
Definition at line 49 of file fileNameI.H.
References fileName::stripInvalid().
Definition at line 60 of file fileNameI.H.
References fileName::stripInvalid().
Definition at line 71 of file fileNameI.H.
References fileName::stripInvalid().
Definition at line 82 of file fileNameI.H.
References fileName::stripInvalid().
Definition at line 310 of file fileName.C.
Definition at line 330 of file fileName.C.
Definition at line 27 of file fileNameIO.C.
Definition at line 35 of file fileNameIO.C.
References Foam::FieldOps::assign(), token::isQuotedString(), token::isWord(), token::stringToken(), and token::wordToken().
Referenced by Foam::expandLeadingTag(), and Foam::operator>>().
|
inlinestatic |
Definition at line 95 of file fileNameI.H.
References Foam::constant::universal::c, and Foam::isspace().
Referenced by FileName::valid().
|
static |
Definition at line 199 of file fileName.C.
Referenced by Foam::argList::get< Foam::fileName >().
|
static |
Definition at line 211 of file fileName.C.
Referenced by dictionary::add(), dictionary::dictionary(), and scene::write().
|
static |
Definition at line 238 of file fileName.C.
|
inline |
Definition at line 106 of file fileNameI.H.
References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::exit().
Referenced by fileName::fileName().
|
static |
Definition at line 192 of file fileName.C.
Referenced by writeFile::baseFileDir(), dictionary::cfindScopedDict(), externalFileCoupler::externalFileCoupler(), IOobject::fileNameComponents(), meshRefinement::findRegions(), averageNeighbourFvGeometryScheme::movePoints(), argList::parse(), probes::prepare(), abort::read(), shortestPathSet::shortestPathSet(), and mappedPatchBase::subRegistry().
bool clean | ( | ) |
Definition at line 383 of file fileName.C.
Referenced by dictionary::makeScopedDict(), and entry::New().
Foam::fileName::Type type | ( | bool | followLink = true , |
bool | checkGzip = false |
||
) | const |
Definition at line 353 of file fileName.C.
Referenced by Foam::cp(), Foam::mv(), and fvMeshDistribute::printFieldInfo().
|
inlinestatic |
Definition at line 129 of file fileNameI.H.
Referenced by pointNoise::calculate(), surfaceNoise::calculate(), chemkinReader::chemkinReader(), uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::filePathInfo(), Foam::ln(), argList::parse(), abort::read(), surfaceFormatsCore::relativeFilePath(), includeEtcEntry::resolveEtcFile(), includeEntry::resolveFile(), collatedFileOperation::writeObject(), and triSurfaceMesh::writeObject().
|
inline |
Definition at line 151 of file fileNameI.H.
Foam::fileName & toAbsolute | ( | ) |
Definition at line 370 of file fileName.C.
References Foam::cwd(), and f().
|
static |
Definition at line 279 of file fileName.C.
References Foam::dot(), and s.
|
inline |
Definition at line 157 of file fileNameI.H.
|
inlinestatic |
Definition at line 192 of file fileNameI.H.
Referenced by fileMonitorWatcher::addWatch(), seriesWriter::append(), argList::argList(), timeVaryingMappedFixedValuePointPatchField< Type >::checkTable(), dynamicCode::copyOrCreateFiles(), Foam::cp(), Foam::mv(), Time::New(), processorPolyPatch::order(), probes::prepare(), fileOperation::processorsPath(), ensightCase::setTime(), timeVaryingMappedFixedValuePointPatchField< Type >::updateCoeffs(), MappedFile< Type >::value(), ensightSetWriter< Type >::write(), abaqusWriter::write(), ensightWriter::writeCollated(), nastranWriter::writeTemplate(), streamLineBase::writeToFile(), and ensightWriter::writeUncollated().
|
inline |
Definition at line 205 of file fileNameI.H.
Referenced by fileName::name(), entry::New(), and scene::write().
|
static |
Definition at line 389 of file fileName.C.
References Foam::dot().
Referenced by dlLibraryTable::basename(), surfaceNoise::calculate(), seriesWriter::print(), and seriesWriter::scan().
|
inline |
Definition at line 217 of file fileNameI.H.
Referenced by vtmWriter::append(), and fileName::name().
Definition at line 284 of file fileName.H.
References fileName::name(), and fileName::nameLessExt().
|
inlinestatic |
Definition at line 169 of file fileNameI.H.
Referenced by fileMonitorWatcher::addWatch(), timeVaryingMappedFixedValuePointPatchField< Type >::checkTable(), chemkinReader::chemkinReader(), dynamicCode::copyOrCreateFiles(), Foam::cp(), dynamicCode::createMakeFiles(), dynamicCode::createMakeOptions(), includeEntry::execute(), isoSurfacePoint::isoSurfacePoint(), seriesWriter::load(), Foam::mkDir(), Time::New(), pointHistory::pointHistory(), fileOperation::processorsPath(), surfMesh::removeFiles(), polyMesh::removeFiles(), seriesWriter::scan(), seriesWriter::write(), proxyWriter::write(), x3dWriter::write(), starcdWriter::write(), foamWriter::write(), rawWriter::write(), vtkWriter::write(), abaqusWriter::write(), nastranWriter::write(), vtmWriter::write(), ensightWriter::writeCollated(), dynamicCode::writeDigest(), isoAdvection::writeIsoFaces(), triSurfaceMesh::writeObject(), fileOperation::writeObject(), distributedTriSurfaceMesh::writeObject(), Foam::vtk::writePointSet(), abaqusWriter::writeTemplate(), rawWriter::writeTemplate(), nastranWriter::writeTemplate(), foamWriter::writeTemplate(), starcdWriter::writeTemplate(), boundaryDataWriter::writeTemplate(), x3dWriter::writeTemplate(), streamLineBase::writeToFile(), and ensightWriter::writeUncollated().
|
inline |
Definition at line 186 of file fileNameI.H.
References path().
Referenced by entry::New().
|
inline |
Definition at line 163 of file fileNameI.H.
References string::hasPath().
|
inline |
Definition at line 236 of file fileNameI.H.
References string::removePath().
Referenced by seriesWriter::append().
Foam::fileName relative | ( | const fileName & | parent, |
const bool | caseTag = false |
||
) | const |
Definition at line 418 of file fileName.C.
References f().
|
inline |
Definition at line 223 of file fileNameI.H.
Referenced by Foam::dlOpen(), STARCDsurfaceFormat< Face >::read(), STARCDedgeFormat::read(), ensightSetWriter< Type >::write(), STARCDsurfaceFormat< Face >::write(), FIREMeshWriter::write(), STARCDedgeFormat::write(), Foam::vtk::writePointSet(), and abaqusWriter::writeTemplate().
|
inline |
Definition at line 211 of file fileNameI.H.
References string::ext().
Referenced by Foam::dlOpen(), seriesWriter::load(), UnsortedMeshedSurface< Face >::New(), MeshedSurface< Foam::face >::New(), triSurface::New(), seriesWriter::print(), edgeMesh::read(), extendedEdgeMesh::read(), seriesWriter::scan(), FIREMeshWriter::write(), proxyWriter::write(), x3dWriter::write(), starcdWriter::write(), rawWriter::write(), vtkWriter::write(), abaqusWriter::write(), nastranWriter::write(), abaqusWriter::writeTemplate(), rawWriter::writeTemplate(), nastranWriter::writeTemplate(), starcdWriter::writeTemplate(), x3dWriter::writeTemplate(), and NURBS3DSurface::writeVTK().
|
inline |
Definition at line 242 of file fileNameI.H.
References string::ext().
Foam::wordList components | ( | const char | delim = '/' | ) | const |
Definition at line 454 of file fileName.C.
Referenced by dictionary::cfindScopedDict(), and mappedPatchBase::subRegistry().
Foam::word component | ( | const size_type | cmpt, |
const char | delim = '/' |
||
) | const |
Definition at line 474 of file fileName.C.
|
inline |
Definition at line 251 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 262 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 273 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 280 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 287 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 295 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 303 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 311 of file fileNameI.H.
References Foam::FieldOps::assign().
|
inline |
Definition at line 319 of file fileNameI.H.
References Foam::FieldOps::assign().
Foam::fileName & operator/= | ( | const string & | other | ) |
Definition at line 499 of file fileName.C.
References s.
|
inline |
Definition at line 49 of file stringI.H.
Referenced by vtmWriter::append(), Foam::dlOpen(), STLCore::isBinaryName(), seriesWriter::load(), Foam::printSourceFileAndLine(), seriesWriter::scan(), seriesWriter::write(), vtmWriter::write(), and Foam::vtk::writePointSet().
|
inline |
Definition at line 89 of file stringI.H.
Referenced by fileWriter::open(), and seriesWriter::scan().
|
static |
Definition at line 90 of file fileName.H.
|
static |
Definition at line 93 of file fileName.H.
|
static |
Definition at line 96 of file fileName.H.
|
static |
Definition at line 99 of file fileName.H.
Referenced by vtmWriter::add(), Time::dbDir(), fileOperation::filePath(), functionObjectList::findDict(), masterUncollatedFileOperation::fileOrNullOp::operator()(), argList::parse(), fileOperation::processorsPath(), syncObjects::read(), nullWriter::write(), proxyWriter::write(), mappedPatchBase::write(), and surfaceWriter::writeTemplate().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.