FreeFOAM The Cross-Platform CFD Toolkit
word Class Reference

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

#include <OpenFOAM/word.H>


Detailed Description

A class for handling words, derived from string.

A word is a string of characters containing no whitespace and may be constructed from a string by removing whitespace. Words are delimited by whitespace.

Source files

Definition at line 61 of file word.H.

+ Inheritance diagram for word:
+ Collaboration diagram for word:

List of all members.

Public Member Functions

 word ()
 Construct null.
 word (const word &)
 Construct as copy.
 word (const char *, const bool doStripInvalid=true)
 Construct as copy of character array.
 word (const char *, const size_type, const bool doStripInvalid)
 Construct as copy with a maximum number of characters.
 word (const string &, const bool doStripInvalid=true)
 Construct as copy of string.
 word (const std::string &, const bool doStripInvalid=true)
 Construct as copy of std::string.
 word (Istream &)
 Construct from Istream.
const wordoperator= (const word &)
const wordoperator= (const string &)
const wordoperator= (const std::string &)
const wordoperator= (const char *)
- Public Member Functions inherited from string
 string ()
 Construct null.
 string (const std::string &)
 Construct from std::string.
 string (const char *)
 Construct as copy of character array.
 string (const char *, const size_type)
 Construct as copy of specified number of characters.
 string (const char)
 Construct from a single character.
 string (Istream &)
 Construct from Istream.
size_type count (const char) const
 Count and return the number of a given character in the string.
stringreplace (const string &oldStr, const string &newStr, size_type start=0)
 Replace first occurence of sub-string oldStr with newStr.
stringreplaceAll (const string &oldStr, const string &newStr, size_type start=0)
 Replace all occurences of sub-string oldStr with newStr.
stringexpand ()
 Expand initial tildes and all occurences of environment variables.
bool removeRepeated (const char)
 Remove repeated characters returning true if string changed.
string removeRepeated (const char) const
 Return string with repeated characters removed.
bool removeTrailing (const char)
 Remove trailing character returning true if string changed.
string removeTrailing (const char) const
 Return string with trailing character removed.
string operator() (const size_type i, const size_type n) const
 Return the sub-string from the i-th character for n characters.
string operator() (const size_type n) const
 Return the sub-string from the first character for n characters.

Static Public Member Functions

static bool valid (char)
 Is this character valid for a word.
- Static Public Member Functions inherited from string
template<class String >
static bool valid (const string &)
 Is this string type valid?
template<class String >
static bool meta (const string &, const char quote='\\')
 Does this string have particular meta-characters?
template<class String >
static bool stripInvalid (string &)
 Strip invalid characters from the given string.
template<class String >
static String validate (const string &)
 Return a valid String from the given string.
template<class String >
static string quotemeta (const string &, const char quote='\\')
 Return a String with quoted meta-characters from the given string.

Static Public Attributes

static const char *const typeName = "word"
static int debug
static const word null
- Static Public Attributes inherited from string

Friends

word operator& (const word &, const word &)
Istreamoperator>> (Istream &, word &)
Ostreamoperator<< (Ostream &, const word &)

Constructor & Destructor Documentation

word ( )
inline

Construct null.

Definition at line 61 of file wordI.H.

word ( const word w)
inline

Construct as copy.

Definition at line 55 of file wordI.H.

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

Construct as copy of character array.

Definition at line 89 of file wordI.H.

word ( const char *  s,
const size_type  n,
const bool  doStripInvalid 
)
inline

Construct as copy with a maximum number of characters.

Definition at line 100 of file wordI.H.

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

Construct as copy of string.

Definition at line 67 of file wordI.H.

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

Construct as copy of std::string.

Definition at line 78 of file wordI.H.

word ( Istream is)

Construct from Istream.

Definition at line 34 of file wordIO.C.


Member Function Documentation

bool valid ( char  c)
inlinestatic

Is this character valid for a word.

Definition at line 117 of file wordI.H.

References Foam::isspace().

Referenced by ISstream::read().

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

Reimplemented in wordRe, and keyType.

Definition at line 134 of file wordI.H.

Referenced by keyType::operator=(), and wordRe::operator=().

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

Reimplemented in wordRe, and keyType.

Definition at line 141 of file wordI.H.

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

Reimplemented in wordRe.

Definition at line 149 of file wordI.H.

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

Reimplemented in wordRe, and keyType.

Definition at line 157 of file wordI.H.


Friends And Related Function Documentation

word operator& ( const word ,
const word  
)
friend
Istream& operator>> ( Istream ,
word  
)
friend
Ostream& operator<< ( Ostream ,
const word  
)
friend

Member Data Documentation

const char *const typeName = "word"
static

Reimplemented from string.

Definition at line 75 of file word.H.

int debug
static

Reimplemented from string.

Definition at line 76 of file word.H.

Referenced by wordRe::uncompile().


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