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 ensightFileName_H
45 #define 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 
85  // Member Functions
86 
87  //- Is this character valid for an ensight file-name
88  inline static bool valid(char c);
89 
90  //- Strip invalid characters
91  inline void stripInvalid();
92 
93 
94  // Member Operators
95 
96  // Assignment (disabled)
97 
98  void operator=(const fileName&) = delete;
99  void operator=(const word&) = delete;
100  void operator=(const string&) = delete;
101  void operator=(const std::string&) = delete;
102  void operator=(const char*) = delete;
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace ensight
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 //- Hashing for FileName is the same as string
113 template<> struct Hash<ensight::FileName> : string::hasher {};
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #include "ensightFileNameI.H"
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
s
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))
Definition: gmvOutputSpray.H:25
Foam::ensight::FileName::FileName
FileName(const FileName &)=default
Copy construct.
Foam::ensight::FileName
Specification of a valid Ensight file-name.
Definition: ensightFileName.H:60
Foam::Hash
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Definition: Hash.H:53
Foam::ensight::FileName::operator=
void operator=(const fileName &)=delete
Foam::ensight::FileName::valid
static bool valid(char c)
Is this character valid for an ensight file-name.
Definition: ensightFileNameI.H:51
fileName.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::string::hasher
Hashing functor for string and derived string classes.
Definition: string.H:147
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
ensightFileNameI.H
word.H
Foam::ensight::FileName::stripInvalid
void stripInvalid()
Strip invalid characters.
Definition: ensightFileNameI.H:62