OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

string Class Reference

Inheritance diagram for string:

Inheritance graph
[legend]
Collaboration diagram for string:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 68 of file string.H.


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.
string & replace (const string &oldStr, const string &newStr, size_type start=0)
 Replace first occurence of sub-string oldStr with newStr.
string & replaceAll (const string &oldStr, const string &newStr, size_type start=0)
 Replace all occurences of sub-string oldStr with newStr.
string & expand ()
 Expand all occurences of environment variables and ~.
bool removeRepeated (const char character)
 Remove repeated characters returning true if string changed.
string removeRepeated (const char character) const
 Return string with repeated characters removed.
bool removeTrailing (const char character)
 Remove trailing character returning true if string changed.
string removeTrailing (const char character) const
 Return string with trailing character removed.
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>
static bool valid (const string &)
 Is this string type valid.
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.

Static Public Attributes

static int debug
 Debug switch.
static const string null
 Null string.

Friends

Istream & operator>> (Istream &, string &)
Ostream & operator<< (Ostream &, const string &)

Classes

class  hash
 Hashing function class. More...

Constructor & Destructor Documentation

string (  )  [inline]

Construct null.

Definition at line 36 of file stringI.H.

string ( const std::string &   )  [inline]

Construct from std::string.

Definition at line 40 of file stringI.H.

string ( const char *   )  [inline]

Construct as copy of character array.

Definition at line 47 of file stringI.H.

string ( const char *  ,
const   size_type 
) [inline]

Construct as copy of specified number of characters.

Definition at line 54 of file stringI.H.

string ( const   char  )  [inline]

Construct from a single character.

Definition at line 61 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.

bool valid ( const string &   )  [inline, static]

Is this string type valid.

Definition at line 70 of file stringI.H.

bool stripInvalid ( string &   )  [inline, static]

Strip invalid characters from the given string.

Definition at line 88 of file stringI.H.

String validate ( const string &   )  [inline, static]

Return a valid String from the given string.

Definition at line 122 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

string& expand (  ) 

Expand all occurences of environment variables and ~.

bool removeRepeated ( const char  character  ) 

Remove repeated characters returning true if string changed.

string removeRepeated ( const char  character  )  const

Return string with repeated characters removed.

bool removeTrailing ( const char  character  ) 

Remove trailing character returning true if string changed.

string removeTrailing ( const char  character  )  const

Return string with trailing character removed.

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

Definition at line 133 of file stringI.H.

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

Definition at line 142 of file stringI.H.


Friends And Related Function Documentation

Istream& operator>> ( Istream &  ,
string &   
) [friend]

Ostream& operator<< ( Ostream &  ,
const 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:
  • src/OpenFOAM/primitives/strings/string/string.H
  • src/OpenFOAM/primitives/strings/string/stringI.H
Copyright © 2000-2007 OpenCFD Ltd