ensightFileName.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::ensight::FileName
28 
29 Description
30  Specification of a valid Ensight file-name.
31 
32  Spaces must be quoted,
33  no '*' wildcards, no '%' (structured block continuation).
34 
35  Overall line length within case file is limited to 1024, but this is not
36  yet addressed.
37 
38 Note
39  To assist windows usage, a colon (':') in the name is replaced with
40  by an underscore.
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_ensightFileName_H
45 #define Foam_ensightFileName_H
46 
47 #include "fileName.H"
48 #include "word.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 namespace ensight
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class ensight::FileName Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class FileName
62 :
63  public fileName
64 {
65 public:
66 
67  // Generated Methods
68 
69  //- Copy construct
70  FileName(const FileName&) = default;
71 
72  //- Move construct
73  FileName(FileName&&) = default;
74 
75 
76  // Constructors
77 
78  //- Construct as copy of character array
79  inline explicit FileName(const char* s);
80 
81  //- Copy construct from std::string
82  inline explicit FileName(const std::string& s);
83 
84  //- Move construct from std::string
85  inline explicit FileName(std::string&& s);
86 
87 
88  // Member Functions
89 
90  //- Is this character valid for an ensight file-name
91  inline static bool valid(char c);
92 
93  //- Strip invalid characters
94  inline void stripInvalid();
95 
96 
97  // Member Operators
98 
99  // Assignment (disabled)
100 
101  void operator=(const fileName&) = delete;
102  void operator=(const word&) = delete;
103  void operator=(const string&) = delete;
104  void operator=(const std::string&) = delete;
105  void operator=(const char*) = delete;
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace ensight
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 //- Hashing for FileName is the same as string
116 template<> struct Hash<ensight::FileName> : string::hasher {};
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
126 
127 #endif
128 
129 // ************************************************************************* //
void operator=(const fileName &)=delete
A class for handling file names.
Definition: fileName.H:72
FileName(const FileName &)=default
Copy construct.
Specification of a valid Ensight file-name.
A class for handling words, derived from Foam::string.
Definition: word.H:63
static bool valid(char c)
Is this character valid for an ensight file-name.
Hashing functor for string and derived string classes.
Definition: string.H:171
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Definition: Hash.H:47
const dimensionedScalar c
Speed of light in a vacuum.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void stripInvalid()
Strip invalid characters.
Namespace for OpenFOAM.