1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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*, 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 // ************************************************************************* //