Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
word Class Reference

A class for handling words, derived from Foam::string. More...

Inheritance diagram for word:
Inheritance graph
[legend]
Collaboration diagram for word:
Collaboration graph
[legend]

Public Member Functions

 word ()=default
 
 word (const word &)=default
 
 word (word &&w)=default
 
 word (const string &s, bool doStrip=true)
 
 word (string &&s, bool doStrip=true)
 
 word (const std::string &s, bool doStrip=true)
 
 word (std::string &&s, bool doStrip=true)
 
 word (const char *s, bool doStrip=true)
 
 word (const char *s, size_type len, bool doStrip)
 
 word (Istream &is)
 
void stripInvalid ()
 
word lessExt () const
 
word ext () const
 
wordext (const word &ending)
 
wordoperator= (const word &s)
 
wordoperator= (word &&s)
 
wordoperator= (const string &s)
 
wordoperator= (string &&s)
 
wordoperator= (const std::string &s)
 
wordoperator= (std::string &&s)
 
wordoperator= (const char *s)
 
template<class PrimitiveType >
Foam::word printf (const char *fmt, const PrimitiveType &val)
 
template<class PrimitiveType >
Foam::word printf (const std::string &fmt, const PrimitiveType &val)
 
bool hasExt () const
 
bool hasExt (const char *ending) const
 
bool hasExt (const std::string &ending) const
 
bool hasExt (const wordRe &ending) const
 
bool removeExt ()
 
- Public Member Functions inherited from string
 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
 
stringreplace (const std::string &s1, const std::string &s2, size_type pos=0)
 
stringreplaceAll (const std::string &s1, const std::string &s2, size_type pos=0)
 
stringreplaceAny (const std::string &s1, const char c2, size_type pos=0)
 
stringexpand (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 PrimitiveType >
static word printf (const char *fmt, const PrimitiveType &val)
 
template<class PrimitiveType >
static word printf (const std::string &fmt, const PrimitiveType &val)
 
static bool valid (char c)
 
static word validate (const std::string &s, const bool prefix=false)
 
static word validate (const char *first, const char *last, const bool prefix=false)
 
- Static Public Member Functions inherited from string
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 = "word"
 
static int debug
 
static const word null
 
- Static Public Attributes inherited from string
static const char *const typeName = "string"
 
static int debug
 
static const string null
 

Additional Inherited Members

- Protected Member Functions inherited from string
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 inherited from string
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)
 

Detailed Description

A class for handling words, derived from Foam::string.

A word is a string of characters without whitespace, quotes, slashes, semicolons or brace brackets. Words are delimited by whitespace.

Source files

Definition at line 63 of file word.H.

Constructor & Destructor Documentation

◆ word() [1/10]

word ( )
default

◆ word() [2/10]

word ( const word )
default

◆ word() [3/10]

word ( word &&  w)
default

◆ word() [4/10]

word ( const string s,
bool  doStrip = true 
)
inline

Definition at line 69 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [5/10]

word ( string &&  s,
bool  doStrip = true 
)
inline

Definition at line 80 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [6/10]

word ( const std::string &  s,
bool  doStrip = true 
)
inline

Definition at line 102 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [7/10]

word ( std::string &&  s,
bool  doStrip = true 
)
inline

Definition at line 91 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [8/10]

word ( const char *  s,
bool  doStrip = true 
)
inline

Definition at line 113 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [9/10]

word ( const char *  s,
size_type  len,
bool  doStrip 
)
inline

Definition at line 124 of file wordI.H.

References word::stripInvalid().

Here is the call graph for this function:

◆ word() [10/10]

word ( Istream is)
explicit

Definition at line 28 of file wordIO.C.

Member Function Documentation

◆ printf() [1/4]

static word printf ( const char *  fmt,
const PrimitiveType &  val 
)
inlinestatic

◆ printf() [2/4]

static word printf ( const std::string &  fmt,
const PrimitiveType &  val 
)
inlinestatic

◆ valid()

bool valid ( char  c)
inlinestatic

Definition at line 52 of file wordI.H.

References Foam::constant::universal::c, and Foam::isspace().

Referenced by cyclicAMIPolyPatch::cyclicAMIPolyPatch(), cyclicPolyPatch::cyclicPolyPatch(), ISstream::read(), VarName::valid(), keyType::valid(), wordRe::valid(), and word::validate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate() [1/2]

Foam::word validate ( const std::string &  s,
const bool  prefix = false 
)
static

◆ validate() [2/2]

Foam::word validate ( const char *  first,
const char *  last,
const bool  prefix = false 
)
static

Definition at line 71 of file word.C.

References Foam::constant::universal::c, and word::valid().

Here is the call graph for this function:

◆ stripInvalid()

void stripInvalid ( )
inline

Definition at line 137 of file wordI.H.

References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::exit().

Referenced by word::word().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lessExt()

Foam::word lessExt ( ) const

◆ ext() [1/2]

Foam::word ext ( ) const

◆ ext() [2/2]

Foam::word & ext ( const word ending)

Definition at line 125 of file word.C.

References string::ext().

Here is the call graph for this function:

◆ operator=() [1/7]

Foam::word & operator= ( const word s)
inline

Definition at line 159 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [2/7]

Foam::word & operator= ( word &&  s)
inline

Definition at line 170 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [3/7]

Foam::word & operator= ( const string s)
inline

Definition at line 181 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [4/7]

Foam::word & operator= ( string &&  s)
inline

Definition at line 189 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [5/7]

Foam::word & operator= ( const std::string &  s)
inline

Definition at line 197 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [6/7]

Foam::word & operator= ( std::string &&  s)
inline

Definition at line 205 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ operator=() [7/7]

Foam::word & operator= ( const char *  s)
inline

Definition at line 213 of file wordI.H.

References Foam::FieldOps::assign(), and s.

Here is the call graph for this function:

◆ printf() [3/4]

Foam::word printf ( const char *  fmt,
const PrimitiveType &  val 
)
inline

Definition at line 28 of file wordI.H.

References Foam::output().

Here is the call graph for this function:

◆ printf() [4/4]

Foam::word printf ( const std::string &  fmt,
const PrimitiveType &  val 
)
inline

Definition at line 41 of file wordI.H.

References Foam::output().

Here is the call graph for this function:

◆ hasExt() [1/4]

bool hasExt
inline

Definition at line 49 of file stringI.H.

Referenced by Foam::readDir().

Here is the caller graph for this function:

◆ hasExt() [2/4]

bool hasExt
inline

Definition at line 55 of file stringI.H.

◆ hasExt() [3/4]

bool hasExt
inline

Definition at line 61 of file stringI.H.

◆ hasExt() [4/4]

bool hasExt

Definition at line 74 of file string.C.

◆ removeExt()

bool removeExt
inline

Definition at line 89 of file stringI.H.

Member Data Documentation

◆ typeName

const char *const typeName = "word"
static

Definition at line 72 of file word.H.

◆ debug

int debug
static

Definition at line 75 of file word.H.

Referenced by keyType::setType(), keyType::uncompile(), and wordRe::uncompile().

◆ null

const Foam::word null
static

Definition at line 78 of file word.H.

Referenced by surfaceZonesInfo::addCellZonesToMesh(), FIREMeshReader::addPatches(), vtmWriter::append(), minMaxCondition::apply(), interfaceEntry::canonicalName(), surfaceFormatsCore::checkFile(), fluxSummary::checkFlowType(), externalCoupled::compositeName(), pointPatch::constraintType(), pointPatchField< Type >::constraintType(), cyclicAMIPolyPatch::cyclicAMIPolyPatch(), cyclicPolyPatch::cyclicPolyPatch(), STLAsciiParseManual::execute(), fileOperation::exists(), masterUncollatedFileOperation::exists(), string::ext(), faMesh::faMesh(), fvExpressionField::fieldName(), Foam::filteredName(), surfaceFormatsCore::findFile(), boundaryRegion::findIndex(), cellTable::findIndex(), Time::findInstancePath(), topoSet::findIOobject(), fvExprDriver::getFieldClassName(), IOobject::group(), Foam::interpolate(), CloudSubModelBase< CloudType >::localPath(), subModelBase::localPath(), polyTopoChange::makeMesh(), displacementMotionSolverMeshMover::move(), basicSolidChemistryModel::New(), coordinateSystem::New(), collatedFileOperation::objectPath(), properties::objectResultType(), orderedPhasePair::otherName(), cyclicAMIPolyPatch::periodicPatchID(), liquidFilmBase::pg(), rawIOField< Type >::rawIOField(), decomposedBlockData::read(), regionFunctionObject::read(), rigidBodyMotion::read(), MRFZone::read(), BilgerMixtureFraction::read(), sampledSurfaces::read(), fileOperation::readObjects(), masterUncollatedFileOperation::readObjects(), reference::reference(), surfaceFormatsCore::relativeFilePath(), rotatingPressureInletOutletVelocityFvPatchVectorField::rotatingPressureInletOutletVelocityFvPatchVectorField(), sizeDistribution::setCellZoneCells(), forces::setCoordinateSystem(), sensitivitySurfacePoints::setSuffixName(), sensitivitySurface::setSuffixName(), triSurface::triSurface(), triSurfaceMesh::triSurfaceMesh(), nutWallFunctionFvPatchScalarField::U(), token::wordToken(), surfaceSlipDisplacementPointPatchVectorField::write(), surfaceDisplacementPointPatchVectorField::write(), vtkWrite::write(), cyclicAMIPolyPatch::write(), mappedPatchBase::write(), nutWallFunctionFvPatchScalarField::writeLocalEntries(), Foam::writeMeshObject(), and NURBS3DSurface::writeVTK().


The documentation for this class was generated from the following files: