1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 A class for handling words, derived from string.
30 A word is a string of characters without whitespace, quotes, slashes,
31 semicolons or brace brackets. Words are delimited by whitespace.
37 \*---------------------------------------------------------------------------*/
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of friend functions and operators
51 inline word operator&(const word&, const word&);
52 Istream& operator>>(Istream&, word&);
53 Ostream& operator<<(Ostream&, const word&);
56 /*---------------------------------------------------------------------------*\
57 Class word Declaration
58 \*---------------------------------------------------------------------------*/
64 // Private Member Functions
66 //- Strip invalid characters from this word
67 inline void stripInvalid();
72 // Static data members
74 static const char* const typeName;
78 static const word null;
87 inline word(const word&);
89 //- Construct as copy of character array
90 inline word(const char*, const bool doStripInvalid=true);
92 //- Construct as copy with a maximum number of characters
97 const bool doStripInvalid
100 //- Construct as copy of string
101 inline word(const string&, const bool doStripInvalid=true);
103 //- Construct as copy of std::string
104 inline word(const std::string&, const bool doStripInvalid=true);
106 //- Construct from Istream
112 //- Is this character valid for a word
113 inline static bool valid(char);
120 inline const word& operator=(const word&);
121 inline const word& operator=(const string&);
122 inline const word& operator=(const std::string&);
123 inline const word& operator=(const char*);
128 friend word operator&(const word&, const word&);
131 // IOstream operators
133 friend Istream& operator>>(Istream&, word&);
134 friend Ostream& operator<<(Ostream&, const word&);
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 // ************************************************************************* //