Loading...
Searching...
No Matches
localIOdictionary.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) 2015-2017 OpenFOAM Foundation
9 Copyright (C) 2021-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::localIOdictionary
29
30Description
31 localIOdictionary is derived from IOdictionary but excludes parallel
32 master reading.
33
34SourceFiles
35 localIOdictionary.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_localIOdictionary_H
40#define Foam_localIOdictionary_H
41
42#include "baseIOdictionary.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class localIOdictionary Declaration
51\*---------------------------------------------------------------------------*/
52
54:
55 public baseIOdictionary
56{
57public:
58
59 // Constructors
60
61 //- Construct given an IOobject
62 //- and optional fallback dictionary content
63 // A null dictionary pointer is treated like an empty dictionary.
64 explicit localIOdictionary
65 (
66 const IOobject& io,
67 const dictionary* fallback = nullptr
68 );
69
70 //- Construct given an IOobject and fallback dictionary content
72
73 //- Construct given an IOobject, wanted typeName
74 //- and optional fallback dictionary content
75 // A null dictionary pointer is treated like an empty dictionary.
77 (
78 const IOobject& io,
79 const word& wantedType,
80 const dictionary* fallback = nullptr
81 );
82
83 //- Construct given an IOobject and Istream
85
86
87 // Factory Methods
88
89 //- Read and return contents, testing for "dictionary" type.
90 //- The IOobject will not be registered
91 static dictionary readContents(const IOobject& io);
92
93 //- Read and return contents, testing for expected type.
94 //- The IOobject will not be registered
96 (
97 const IOobject& io,
98 const word& wantedType
99 );
100
101
102 //- Destructor
103 virtual ~localIOdictionary() = default;
104
105
106 // Member Functions
107
108 //- The object is not global
109 virtual bool global() const
110 {
111 return false;
112 }
113
114 //- Return complete path + object name if the file exists
115 //- in the case otherwise null
116 virtual fileName filePath() const
117 {
118 // Use default (local only) search strategy
119 return localFilePath(type());
120 }
121};
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
132// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
fileName localFilePath(const word &typeName, const bool search=true) const
Redirect to fileHandler filePath, searching locally.
Definition IOobject.C:593
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
baseIOdictionary(const baseIOdictionary &)=default
Copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
static dictionary readContents(const IOobject &io)
Read and return contents, testing for "dictionary" type. The IOobject will not be registered.
virtual bool global() const
The object is not global.
virtual fileName filePath() const
Return complete path + object name if the file exists in the case otherwise null.
virtual ~localIOdictionary()=default
Destructor.
localIOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
A class for handling words, derived from Foam::string.
Definition word.H:66
const auto & io
const auto & fallback
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
dictionary dict