keyTypeI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
29 :
30  word(),
31  isPattern_(false)
32 {}
33 
34 
36 :
37  word(s, false),
38  isPattern_(s.isPattern())
39 {}
40 
41 
43 :
44  word(s, false),
45  isPattern_(false)
46 {}
47 
48 
49 inline Foam::keyType::keyType(const string& s)
50 :
51  word(s, false),
52  isPattern_(true)
53 {}
54 
55 
56 inline Foam::keyType::keyType(const char* s)
57 :
58  word(s, false),
59  isPattern_(false)
60 {}
61 
62 
63 inline Foam::keyType::keyType
64 (
65  const std::string& s,
66  const bool isPattern
67 )
68 :
69  word(s, false),
70  isPattern_(isPattern)
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
76 inline bool Foam::keyType::isPattern() const
77 {
78  return isPattern_;
79 }
80 
81 
82 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
83 
84 inline const Foam::keyType& Foam::keyType::operator=(const keyType& s)
85 {
86  // Bypass checking
87  string::operator=(s);
88  isPattern_ = s.isPattern_;
89  return *this;
90 }
91 
92 
93 inline const Foam::keyType& Foam::keyType::operator=(const word& s)
94 {
95  word::operator=(s);
96  isPattern_ = false;
97  return *this;
98 }
99 
100 
101 inline const Foam::keyType& Foam::keyType::operator=(const string& s)
102 {
103  // Bypass checking
104  string::operator=(s);
105  isPattern_ = true;
106  return *this;
107 }
108 
109 
110 inline const Foam::keyType& Foam::keyType::operator=(const char* s)
111 {
112  // Bypass checking
113  string::operator=(s);
114  isPattern_ = false;
115  return *this;
116 }
117 
118 
119 // ************************************************************************* //