writeKeyword spacing for keyType, misc cosmetics changes

This commit is contained in:
Mark Olesen
2008-12-10 23:00:39 +01:00
parent 599c1c5976
commit 7473adc89c
10 changed files with 211 additions and 168 deletions

View File

@ -28,8 +28,8 @@ Class
Description
A class for handling keywords in dictionaries.
A keyType is the keyword of a dictionary. It differs from word in that
it accepts wildcards.
A keyType is the keyword of a dictionary.
It differs from word in that it accepts patterns (regular expressions).
SourceFiles
keyType.C
@ -53,7 +53,7 @@ class Ostream;
/*---------------------------------------------------------------------------*\
Class keyType Declaration
Class keyType Declaration
\*---------------------------------------------------------------------------*/
class keyType
@ -78,22 +78,22 @@ public:
inline keyType();
//- Construct as copy
inline keyType(const keyType& s);
inline keyType(const keyType&);
//- Construct as copy of word
inline keyType(const word& s);
inline keyType(const word&);
//- Construct as copy of string. Expect it to be regular expression.
inline keyType(const string& s);
inline keyType(const string&);
//- Construct as copy of character array
inline keyType(const char* s);
inline keyType(const char*);
//- Construct as copy of std::string
inline keyType(const std::string& s, const bool isWildCard);
inline keyType(const std::string&, const bool isPattern);
//- Construct from Istream
keyType(Istream& is);
keyType(Istream&);
// Member functions
@ -101,29 +101,25 @@ public:
//- Is this character valid for a keyType
inline static bool valid(char c);
//- Is the type a wildcard?
inline bool isWildCard() const;
//- Should be treated as a match rather than a literal string
inline bool isPattern() const;
// Member operators
// Assignment
inline void operator=(const keyType& s);
inline void operator=(const keyType&);
inline void operator=(const word&);
//- Assign from regular expression.
inline void operator=(const string& s);
inline void operator=(const word& s);
inline void operator=(const string&);
inline void operator=(const char*);
// IOstream operators
friend Istream& operator>>(Istream& is, keyType& w);
friend Ostream& operator<<(Ostream& os, const keyType& w);
friend Istream& operator>>(Istream&, keyType&);
friend Ostream& operator<<(Ostream&, const keyType&);
};

View File

@ -30,7 +30,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct null
inline Foam::keyType::keyType()
:
word(),
@ -38,15 +37,13 @@ inline Foam::keyType::keyType()
{}
//- Construct as copy
inline Foam::keyType::keyType(const keyType& s)
:
word(s, false),
isWildCard_(s.isWildCard())
isWildCard_(s.isPattern())
{}
//- Construct as copy of word
inline Foam::keyType::keyType(const word& s)
:
word(s, false),
@ -54,7 +51,7 @@ inline Foam::keyType::keyType(const word& s)
{}
//- Construct as copy of string. Expect it to be regular expression
// Construct as copy of string. Expect it to be regular expression
inline Foam::keyType::keyType(const string& s)
:
word(s, false),
@ -62,7 +59,7 @@ inline Foam::keyType::keyType(const string& s)
{}
//- Construct as copy of character array
// Construct as copy of character array
inline Foam::keyType::keyType(const char* s)
:
word(s, false),
@ -74,11 +71,11 @@ inline Foam::keyType::keyType(const char* s)
inline Foam::keyType::keyType
(
const std::string& s,
const bool isWildCard
const bool isPattern
)
:
word(s, false),
isWildCard_(isWildCard)
isWildCard_(isPattern)
{}
@ -90,7 +87,7 @@ inline bool Foam::keyType::valid(char c)
}
bool Foam::keyType::isWildCard() const
bool Foam::keyType::isPattern() const
{
return isWildCard_;
}
@ -102,7 +99,7 @@ inline void Foam::keyType::operator=(const keyType& s)
{
// Bypass checking
string::operator=(s);
isWildCard_ = s.isWildCard();
isWildCard_ = s.isPattern();
}

View File

@ -87,7 +87,7 @@ public:
inline word(const word&);
//- Construct as copy of character array
inline word(const char*, const bool doStripInvalid = true);
inline word(const char*, const bool doStripInvalid=true);
//- Construct as copy with a maximum number of characters
inline word
@ -98,10 +98,10 @@ public:
);
//- Construct as copy of string
inline word(const string&, const bool doStripInvalid = true);
inline word(const string&, const bool doStripInvalid=true);
//- Construct as copy of std::string
inline word(const std::string&, const bool doStripInvalid = true);
inline word(const std::string&, const bool doStripInvalid=true);
//- Construct from Istream
word(Istream&);