1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 inline void Foam::word::stripInvalid()
34 // skip stripping unless debug is active to avoid
36 if (debug && string::stripInvalid<word>(*this))
39 << "word::stripInvalid() called for word "
40 << this->c_str() << std::endl;
45 << " For debug level (= " << debug
46 << ") > 1 this is considered fatal" << std::endl;
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 inline Foam::word::word(const word& w)
61 inline Foam::word::word()
67 inline Foam::word::word(const string& s, const bool doStripInvalid)
78 inline Foam::word::word(const std::string& s, const bool doStripInvalid)
89 inline Foam::word::word(const char* s, const bool doStripInvalid)
99 inline Foam::word::word
103 const bool doStripInvalid
115 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
117 inline bool Foam::word::valid(char c)
122 && c != '"' // string quote
123 && c != '\'' // string quote
124 && c != '/' // path separator
125 && c != ';' // end statement
126 && c != '{' // beg subdict
127 && c != '}' // end subdict
132 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
134 inline const Foam::word& Foam::word::operator=(const word& q)
136 string::operator=(q);
141 inline const Foam::word& Foam::word::operator=(const string& q)
143 string::operator=(q);
149 inline const Foam::word& Foam::word::operator=(const std::string& q)
151 string::operator=(q);
157 inline const Foam::word& Foam::word::operator=(const char* q)
159 string::operator=(q);
165 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
167 inline Foam::word Foam::operator&(const word& a, const word& b)
172 ub.string::operator[](0) = char(toupper(ub.string::operator[](0)));
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 // ************************************************************************* //