functionName.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019 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 Class
25  Foam::functionName
26 
27 Description
28  A functionName is a word starting with '#'.
29 
30 SourceFiles
31  functionName.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef functionName_H
36 #define functionName_H
37 
38 #include "word.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of friend functions and operators
46 class functionName;
47 class Istream;
48 class Ostream;
49 
50 Istream& operator>>(Istream&, functionName&);
51 Ostream& operator<<(Ostream&, const functionName&);
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class functionName Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class functionName
59 :
60  public word
61 {
62 
63 public:
64 
65  // Static Data Members
66 
67  static const char* const typeName;
68  static int debug;
69 
70  //- An empty functionName
71  static const functionName null;
72 
73 
74  // Constructors
75 
76  //- Construct null
77  inline functionName();
78 
79  //- Copy constructor
80  inline functionName(const functionName&);
81 
82  //- Copy constructor of word
83  inline explicit functionName(const word&);
84 
85  //- Copy constructor of string
86  inline explicit functionName
87  (
88  const string&,
89  const bool doStripInvalid=true
90  );
91 
92  //- Copy constructor of std::string
93  inline explicit functionName
94  (
95  const std::string&,
96  const bool doStripInvalid=true
97  );
98 
99  //- Copy constructor of character array
100  inline explicit functionName
101  (
102  const char*,
103  const bool doStripInvalid=true
104  );
105 
106  //- Construct from Istream
107  // Words are treated as literals, strings with an auto-test
108  explicit functionName(Istream&);
109 
110 
111  // Member Functions
112 
113  //- Is this character valid for a functionName
114  inline static bool valid(char);
115 
116 
117  // Member Operators
118 
119  // Assignment
120 
121  inline void operator=(const functionName&);
122  inline void operator=(const word&);
123  inline void operator=(const string&);
124  inline void operator=(const std::string&);
125  inline void operator=(const char*);
126 
127 
128  // IOstream Operators
129 
131  friend Ostream& operator<<(Ostream&, const functionName&);
132 };
133 
134 
135 void writeEntry(Ostream& os, const functionName& value);
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #include "functionNameI.H"
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
static bool valid(char)
Is this character valid for a functionName.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A functionName is a word starting with &#39;#&#39;.
Definition: functionName.H:57
A class for handling words, derived from string.
Definition: word.H:59
Istream & operator>>(Istream &, directionInfo &)
static const functionName null
An empty functionName.
Definition: functionName.H:70
static const char *const typeName
Definition: functionName.H:66
static int debug
Definition: functionName.H:67
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Ostream & operator<<(Ostream &, const ensightPart &)
functionName()
Construct null.
Definition: functionNameI.H:28
Namespace for OpenFOAM.
friend Ostream & operator<<(Ostream &, const functionName &)
void operator=(const functionName &)
Definition: functionNameI.H:78
friend Istream & operator>>(Istream &, functionName &)