OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

keyTypeI.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-2009 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 \*---------------------------------------------------------------------------*/
00026 
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 
00031 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00032 
00033 inline Foam::keyType::keyType()
00034 :
00035     word(),
00036     isPattern_(false)
00037 {}
00038 
00039 
00040 inline Foam::keyType::keyType(const keyType& s)
00041 :
00042     word(s, false),
00043     isPattern_(s.isPattern())
00044 {}
00045 
00046 
00047 inline Foam::keyType::keyType(const word& s)
00048 :
00049     word(s, false),
00050     isPattern_(false)
00051 {}
00052 
00053 
00054 // Construct as copy of string. Expect it to be regular expression
00055 inline Foam::keyType::keyType(const string& s)
00056 :
00057     word(s, false),
00058     isPattern_(true)
00059 {}
00060 
00061 
00062 // Construct as copy of character array
00063 inline Foam::keyType::keyType(const char* s)
00064 :
00065     word(s, false),
00066     isPattern_(false)
00067 {}
00068 
00069 
00070 //- Construct as copy of std::string
00071 inline Foam::keyType::keyType
00072 (
00073     const std::string& s,
00074     const bool isPattern
00075 )
00076 :
00077     word(s, false),
00078     isPattern_(isPattern)
00079 {}
00080 
00081 
00082 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00083 
00084 inline bool Foam::keyType::isPattern() const
00085 {
00086     return isPattern_;
00087 }
00088 
00089 
00090 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00091 
00092 inline const Foam::keyType& Foam::keyType::operator=(const keyType& s)
00093 {
00094     // Bypass checking
00095     string::operator=(s);
00096     isPattern_ = s.isPattern_;
00097     return *this;
00098 }
00099 
00100 
00101 inline const Foam::keyType& Foam::keyType::operator=(const word& s)
00102 {
00103     word::operator=(s);
00104     isPattern_ = false;
00105     return *this;
00106 }
00107 
00108 
00109 inline const Foam::keyType& Foam::keyType::operator=(const string& s)
00110 {
00111     // Bypass checking
00112     string::operator=(s);
00113     isPattern_ = true;
00114     return *this;
00115 }
00116 
00117 
00118 inline const Foam::keyType& Foam::keyType::operator=(const char* s)
00119 {
00120     // Bypass checking
00121     string::operator=(s);
00122     isPattern_ = false;
00123     return *this;
00124 }
00125 
00126 
00127 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd