FreeFOAM The Cross-Platform CFD Toolkit
keyType Class Reference

A class for handling keywords in dictionaries. More...

#include <OpenFOAM/keyType.H>


Detailed Description

A class for handling keywords in dictionaries.

A keyType is the keyword of a dictionary. It differs from word in that it accepts patterns (regular expressions).

Source files

Definition at line 58 of file keyType.H.

+ Inheritance diagram for keyType:
+ Collaboration diagram for keyType:

List of all members.

Public Member Functions

 keyType ()
 Construct null.
 keyType (const keyType &)
 Construct as copy.
 keyType (const word &)
 Construct as copy of word.
 keyType (const string &)
 Construct as copy of string. Expect it to be regular expression.
 keyType (const char *)
 Construct as copy of character array.
 keyType (const std::string &, const bool isPattern)
 Construct as copy of std::string.
 keyType (Istream &)
 Construct from Istream.
bool isPattern () const
 Should be treated as a match rather than a literal string.
const keyTypeoperator= (const keyType &)
const keyTypeoperator= (const word &)
const keyTypeoperator= (const string &)
 Assign from regular expression.
const keyTypeoperator= (const char *)
- Public Member Functions inherited from word
 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.
- 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.

Friends

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

Additional Inherited Members

- Static Public Member Functions inherited from word
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 inherited from word
static const char *const typeName = "word"
static int debug
static const word null
- Static Public Attributes inherited from string

Constructor & Destructor Documentation

keyType ( )
inline

Construct null.

Definition at line 32 of file keyTypeI.H.

keyType ( const keyType s)
inline

Construct as copy.

Definition at line 39 of file keyTypeI.H.

keyType ( const word s)
inline

Construct as copy of word.

Definition at line 46 of file keyTypeI.H.

keyType ( const string s)
inline

Construct as copy of string. Expect it to be regular expression.

Definition at line 54 of file keyTypeI.H.

keyType ( const char *  s)
inline

Construct as copy of character array.

Definition at line 62 of file keyTypeI.H.

keyType ( const std::string &  s,
const bool  isPattern 
)
inline

Construct as copy of std::string.

Definition at line 71 of file keyTypeI.H.

keyType ( Istream is)

Construct from Istream.

Definition at line 34 of file keyTypeIO.C.


Member Function Documentation

bool isPattern ( ) const
inline

Should be treated as a match rather than a literal string.

Definition at line 83 of file keyTypeI.H.

Referenced by dictionary::add(), dictionary::changeKeyword(), Ostream::write(), and Ostream::writeKeyword().

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

Definition at line 91 of file keyTypeI.H.

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

Reimplemented from word.

Definition at line 100 of file keyTypeI.H.

References word::operator=().

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

Assign from regular expression.

Reimplemented from word.

Definition at line 108 of file keyTypeI.H.

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

Reimplemented from word.

Definition at line 117 of file keyTypeI.H.


Friends And Related Function Documentation

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

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