caseFileConfiguration.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) 2023 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::caseFileConfiguration
26 
27 Description
28  Base class for writing case files.
29 
30 SourceFiles
31  caseFileConfiguration.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef caseFileConfiguration_H
36 #define caseFileConfiguration_H
37 
38 #include "IOobject.H"
39 #include "OFstream.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class caseFileConfiguration Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 {
52 
53 protected:
54 
55  // Protected Data
56 
57  //- IOobject to write file headers
59 
60  //- Output file stream to write file content
61  OFstream os_;
62 
63 
64  // Protected Functions
65 
66  //- Output stream to begin a new dictionary without name
67  void beginDict(OFstream& os);
68 
69  //- Output stream to begin a new dictionary with name
70  void beginDict(OFstream& os, const word& name);
71 
72  //- Output stream to end a dictionary
73  void endDict(OFstream& os, bool newline=true);
74 
75  //- Output stream to begin a new list without name
76  void beginList(OFstream& os);
77 
78  //- Output stream to begin a new list with name
79  void beginList(OFstream& os, const word& name);
80 
81  //- Output stream to end a list
82  void endList(OFstream& os, bool newline=true);
83 
84 
85 public:
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const fileName& name,
93  const fileName& dir,
94  const Time& time
95  );
96 
97  //- Disallow default bitwise copy construction
99 
100 
101  //- Destructor
103 
104 
105  // Member Operators
106 
107  //- Disallow default bitwise assignment
108  void operator=(const caseFileConfiguration&) = delete;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
Output to file stream.
Definition: OFstream.H:86
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Base class for writing case files.
~caseFileConfiguration()
Destructor.
void endList(OFstream &os, bool newline=true)
Output stream to end a list.
void beginDict(OFstream &os)
Output stream to begin a new dictionary without name.
OFstream os_
Output file stream to write file content.
void operator=(const caseFileConfiguration &)=delete
Disallow default bitwise assignment.
caseFileConfiguration(const fileName &name, const fileName &dir, const Time &time)
Construct from components.
void beginList(OFstream &os)
Output stream to begin a new list without name.
IOobject dict_
IOobject to write file headers.
void endDict(OFstream &os, bool newline=true)
Output stream to end a dictionary.
A class for handling file names.
Definition: fileName.H:82
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39