1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 A class for handling words, derived from string.
31 A word is a string of characters containing no whitespace and may be
32 constructed from a string by removing whitespace. Words are delimited
39 \*---------------------------------------------------------------------------*/
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of friend functions and operators
53 inline word operator&(const word&, const word&);
54 Istream& operator>>(Istream&, word&);
55 Ostream& operator<<(Ostream&, const word&);
58 /*---------------------------------------------------------------------------*\
59 Class word Declaration
60 \*---------------------------------------------------------------------------*/
66 // Private member functions
68 //- Strip invalid characters from this word
69 inline void stripInvalid();
74 // Static data members
76 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*);
92 //- Construct as copy with a maximum number of characters
93 inline word(const char*, const size_type);
95 //- Construct as copy of string
96 inline word(const string&);
98 //- Construct as copy of std::string
99 inline word(const std::string&);
101 //- Construct from Istream
107 //- Is this character valid for a word
108 inline static bool valid(char);
115 inline void operator=(const word&);
116 inline void operator=(const string&);
117 inline void operator=(const std::string&);
118 inline void operator=(const char*);
123 friend word operator&(const word&, const word&);
126 // IOstream operators
128 friend Istream& operator>>(Istream&, word&);
129 friend Ostream& operator<<(Ostream&, const word&);
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 } // End namespace Foam
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 // ************************************************************************* //