OpenFOAM logo
Open Source CFD Toolkit

string Class Reference

Inheritance diagram for string:

Inheritance graph
[legend]
Collaboration diagram for string:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 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 all occurences of environment variables and ~.
string operator() (const size_type i, const size_type n) const
string operator() (const size_type n) const

Static Public Member Functions

template<class String>
bool valid (const string &)
 Is this string type valid.
template<class String>
bool stripInvalid (string &)
 Strip invalid characters from the given string.
template<class String>
String validate (const string &)
 Return a valid String from the given string.

Static Public Attributes

int debug
 Debug switch.
const string null
 Null string.

Friends

Istreamoperator>> (Istream &, string &)
Ostreamoperator<< (Ostream &, const string &)

Constructor & Destructor Documentation

string  )  [inline]
 

Construct null.

Definition at line 41 of file stringI.H.

string const std::string &   )  [inline]
 

Construct from std::string.

Definition at line 45 of file stringI.H.

string const char *   )  [inline]
 

Construct as copy of character array.

Definition at line 52 of file stringI.H.

string const char *  ,
const   size_type
[inline]
 

Construct as copy of specified number of characters.

Definition at line 59 of file stringI.H.

string const   char  )  [inline]
 

Construct from a single character.

Definition at line 66 of file stringI.H.

string Istream  ) 
 

Construct from Istream.


Member Function Documentation

size_type count const   char  )  const
 

Count and return the number of a given character in the string.

string& expand  ) 
 

Expand all occurences of environment variables and ~.

string operator() const size_type  n  )  const [inline]
 

Definition at line 143 of file stringI.H.

string operator() const size_type  i,
const size_type  n
const [inline]
 

Definition at line 137 of file stringI.H.

string& replace const string oldStr,
const string newStr,
size_type  start = 0
 

Replace first occurence of sub-string oldStr with newStr.

starting at start

string& replaceAll const string oldStr,
const string newStr,
size_type  start = 0
 

Replace all occurences of sub-string oldStr with newStr.

starting at start

bool stripInvalid string  )  [inline, static]
 

Strip invalid characters from the given string.

Definition at line 93 of file stringI.H.

Referenced by fileName::fileName(), word::operator=(), and word::word().

bool valid const string  )  [inline, static]
 

Is this string type valid.

Definition at line 75 of file stringI.H.

String validate const string  )  [inline, static]
 

Return a valid String from the given string.

Definition at line 127 of file stringI.H.


Friends And Related Function Documentation

Ostream& operator<< Ostream ,
const string
[friend]
 

Istream& operator>> Istream ,
string
[friend]
 


Member Data Documentation

int debug [static]
 

Debug switch.

Reimplemented in fileName, and word.

Definition at line 80 of file string.H.

const string null [static]
 

Null string.

Reimplemented in fileName, and word.

Definition at line 83 of file string.H.


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org