OpenFOAM logo
Open Source CFD Toolkit

word.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     word
00027 
00028 Description
00029     A class for handling words, derived from string.
00030     A word is a string of characters containing no white space and
00031     may be constructed from a string by removing white space.
00032     Words are delimited be white space.
00033 
00034 SourceFiles
00035     word.C
00036     wordIO.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef word_H
00041 #define word_H
00042 
00043 #include "string.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class word Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class word
00055 :
00056     public string
00057 {
00058     // Private member functions
00059 
00060         //- Strip invalid characters from this word
00061         inline void stripInvalid();
00062 
00063 
00064 public:
00065 
00066     //- Debug switch
00067     static int debug;
00068 
00069     //- Null word
00070     static const word null;
00071 
00072 
00073     // Constructors
00074 
00075         //- Construct null
00076         inline word();
00077 
00078         //- Construct as copy
00079         inline word(const word& w);
00080 
00081         //- Construct as copy of character array
00082         inline word(const char*);
00083 
00084         //- Construct as copy of string
00085         inline word(const string&);
00086 
00087         //- Construct as copy of std::string
00088         inline word(const std::string&);
00089 
00090         //- Construct from Istream
00091         word(Istream& is);
00092 
00093 
00094     // Member functions
00095 
00096         //- Is this character valid for a word
00097         inline static bool valid(char);
00098 
00099 
00100     // Member operators
00101 
00102         // Assignment
00103 
00104             inline void operator=(const word&);
00105             inline void operator=(const string&);
00106             inline void operator=(const std::string&);
00107             inline void operator=(const char*);
00108 
00109 
00110     // Friend Operators
00111 
00112         inline friend word operator&(const word&, const word&);
00113 
00114 
00115     // IOstream operators
00116 
00117         friend Istream& operator>>(Istream&, word&);
00118         friend Ostream& operator<<(Ostream&, const word&);
00119 };
00120 
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #include "wordI.H"
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 #endif
00133 
00134 // ************************************************************************* //
For further information go to www.openfoam.org