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
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 inline void Foam::word::stripInvalid()
35 // skip stripping unless debug is active to avoid
37 if (debug && string::stripInvalid<word>(*this))
40 << "word::stripInvalid() called for word "
41 << this->c_str() << std::endl;
46 << " For debug level (= " << debug
47 << ") > 1 this is considered fatal" << std::endl;
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 inline Foam::word::word(const word& w)
62 inline Foam::word::word()
68 inline Foam::word::word(const string& s, const bool doStripInvalid)
79 inline Foam::word::word(const std::string& s, const bool doStripInvalid)
90 inline Foam::word::word(const char* s, const bool doStripInvalid)
100 inline Foam::word::word
104 const bool doStripInvalid
116 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 inline bool Foam::word::valid(char c)
123 && c != '"' // string quote
124 && c != '\'' // string quote
125 && c != '/' // path separator
126 && c != ';' // end statement
127 && c != '{' // beg subdict
128 && c != '}' // end subdict
133 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
135 inline const Foam::word& Foam::word::operator=(const word& q)
137 string::operator=(q);
142 inline const Foam::word& Foam::word::operator=(const string& q)
144 string::operator=(q);
150 inline const Foam::word& Foam::word::operator=(const std::string& q)
152 string::operator=(q);
158 inline const Foam::word& Foam::word::operator=(const char* q)
160 string::operator=(q);
166 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
168 inline Foam::word Foam::operator&(const word& a, const word& b)
173 ub.string::operator[](0) = char(toupper(ub.string::operator[](0)));
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 // ************************ vim: set sw=4 sts=4 et: ************************ //