A class for handling character strings derived from std::string. More...
Classes | |
struct | hash |
struct | hasher |
Public Member Functions | |
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 | |
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 = "string" |
static int | debug |
static const string | null |
Protected Member Functions | |
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 Protected Member Functions | |
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 character strings derived from std::string.
Strings may contain any characters and therefore are delimited by quotes for IO : "any list of characters".
Used as a base class for word and fileName.
|
default |
Definition at line 28 of file stringIO.C.
|
inlinestaticprotected |
|
inlineprotected |
Definition at line 37 of file stringI.H.
Referenced by string::ext().
|
staticprotected |
Definition at line 29 of file stringTemplates.C.
References n, and Foam::output().
|
staticprotected |
Definition at line 57 of file stringTemplates.C.
References Foam::output().
|
protected |
Definition at line 38 of file string.C.
References string::find_ext(), and word::null.
Referenced by word::ext(), and fileName::ext().
|
inlineprotected |
Definition at line 43 of file stringI.H.
References Foam::ListOps::find().
Referenced by fileName::hasPath().
|
inlineprotected |
Definition at line 49 of file stringI.H.
Referenced by string::hasExt().
|
inlineprotected |
Definition at line 55 of file stringI.H.
References string::hasExt().
|
inlineprotected |
Definition at line 74 of file string.C.
References wordRe::isLiteral(), and wordRe::match().
|
inlineprotected |
|
inlineprotected |
Definition at line 75 of file stringI.H.
References erase().
Referenced by fileName::removePath().
|
inlinestatic |
Definition at line 160 of file stringI.H.
References Foam::constant::universal::c.
|
inlinestatic |
Definition at line 189 of file stringI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 211 of file stringI.H.
Referenced by solutionControl::applyToField().
Foam::string & replace | ( | const std::string & | s1, |
const std::string & | s2, | ||
size_type | pos = 0 |
||
) |
Definition at line 101 of file string.C.
References Foam::ListOps::find(), and Foam::pos().
Referenced by argList::displayDoc(), objectRegistry::rename(), ensightSurfaceReader::replaceMask(), cellMotionFvPatchField< Type >::updateCoeffs(), and graph::wordify().
Foam::string & replaceAll | ( | const std::string & | s1, |
const std::string & | s2, | ||
size_type | pos = 0 |
||
) |
Definition at line 117 of file string.C.
References Foam::ListOps::find(), and Foam::pos().
Foam::string & replaceAny | ( | const std::string & | s1, |
const char | c2, | ||
size_type | pos = 0 |
||
) |
Definition at line 140 of file string.C.
References Foam::constant::physicoChemical::c2, erase(), and Foam::pos().
Referenced by FileName::stripInvalid().
Foam::string & expand | ( | const bool | allowEmpty = false | ) |
Definition at line 166 of file string.C.
References Foam::stringOps::inplaceExpand().
Referenced by pointNoise::calculate(), surfaceNoise::calculate(), chemkinReader::chemkinReader(), externalFileCoupler::externalFileCoupler(), offsetSurface::offsetSurface(), tabulated6DoFAcceleration::read(), tabulated6DoFMotion::read(), abort::read(), Curle::read(), surfaceFormatsCore::relativeFilePath(), IOobject::selectIO(), Table< Type >::Table(), TableFile< Type >::TableFile(), and triSurfaceMesh::writeObject().
bool removeRepeated | ( | const char | character | ) |
Definition at line 173 of file string.C.
References stdFoam::begin(), Foam::constant::universal::c, stdFoam::cbegin(), stdFoam::cend(), erase(), and Foam::ListOps::find().
bool removeStart | ( | const std::string & | text | ) |
Definition at line 207 of file string.C.
References erase().
Referenced by dlLibraryTable::basename().
bool removeStart | ( | const char | c | ) |
Definition at line 237 of file string.C.
References Foam::constant::universal::c, and erase().
bool removeEnd | ( | const std::string & | text | ) |
Definition at line 222 of file string.C.
References erase().
Referenced by NASsurfaceFormat< Face >::read(), and string::removeTrailing().
bool removeEnd | ( | const char | c | ) |
Definition at line 249 of file string.C.
References Foam::constant::universal::c, erase(), and n.
|
inline |
Definition at line 217 of file stringI.H.
Referenced by keyType::swap(), and wordRe::swap().
|
inline |
Definition at line 293 of file string.H.
References s.
Referenced by argList::displayDoc(), Foam::dlOpen(), argList::parse(), fileOperation::processorsPath(), ABAQUSCore::readHelper::read(), seriesWriter::scan(), and string::startsWith().
|
inline |
Definition at line 299 of file string.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 305 of file string.H.
References s.
Referenced by dynamicOversetFvMesh::baseName(), and string::endsWith().
|
inline |
Definition at line 311 of file string.H.
References Foam::constant::universal::c.
Foam::string::size_type count | ( | const char | c | ) | const |
Definition at line 94 of file string.C.
References Foam::constant::universal::c, and Foam::stringOps::count().
|
inline |
Definition at line 323 of file string.H.
References s, and string::starts_with().
|
inline |
Definition at line 327 of file string.H.
References string::ends_with(), and s.
|
inline |
Definition at line 331 of file string.H.
References Foam::constant::universal::c, and string::removeEnd().
|
static |
Definition at line 165 of file string.H.
Referenced by ABAQUSCore::readHelper::addNewElset(), genericRagelLemonDriver::clear(), argList::printMan(), Foam::printManOption(), Foam::printOption(), argList::printUsage(), token::stringToken(), and OFstreamCollator::write().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.