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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::ensight::FileName
28
29Description
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
38Note
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
52namespace Foam
54namespace ensight
55{
56
57/*---------------------------------------------------------------------------*\
58 Class ensight::FileName Declaration
59\*---------------------------------------------------------------------------*/
61class FileName
62:
63 public fileName
64{
65public:
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)
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
113template<> 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// ************************************************************************* //
Specification of a valid Ensight file-name.
void operator=(const word &)=delete
void operator=(const string &)=delete
void operator=(const char *)=delete
FileName(FileName &&)=default
Move construct.
static bool valid(char c)
Is this character valid for an ensight file-name.
FileName(const FileName &)=default
Copy construct.
void stripInvalid()
Strip invalid characters.
void operator=(const std::string &)=delete
void operator=(const fileName &)=delete
A class for handling file names.
Definition: fileName.H:76
A class for handling words, derived from Foam::string.
Definition: word.H:68
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))
Namespace for OpenFOAM.
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Definition: Hash.H:54
Hashing functor for string and derived string classes.
Definition: string.H:148