dictionaryIO.C
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) 2011-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 \*---------------------------------------------------------------------------*/
25 
26 #include "dictionary.H"
27 #include "IOobject.H"
28 #include "inputSyntaxEntry.H"
29 #include "inputModeEntry.H"
30 #include "calcIncludeEntry.H"
31 #include "stringOps.H"
32 #include "etcFiles.H"
33 #include "wordAndDictionary.H"
34 #include "OSspecific.H"
35 
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
39 (
40  const fileName& name,
41  const dictionary& parentDict,
42  Istream& is
43 )
44 :
46  (
47  parentDict.name().size()
48  ? parentDict.name()/name
49  : name
50  ),
51  parent_(parentDict)
52 {
53  read(is);
54 }
55 
56 
57 Foam::dictionary::dictionary(Istream& is, const bool keepHeader)
58 :
59  dictionaryName(is.name()),
60  parent_(dictionary::null)
61 {
62  // Reset input syntax as this is a "top-level" dictionary
64 
65  // Reset input mode as this is a "top-level" dictionary
67 
68  // Clear the cache of #calc include files
70 
71  read(is, keepHeader);
72 }
73 
74 
76 (
77  const fileName& fName,
78  const dictionary& parentDict
79 )
80 :
81  dictionary(fName),
82  global_(parentDict.topDict().global())
83 {
84  autoPtr<ISstream> ifsPtr
85  (
86  fileHandler().NewIFstream(fName)
87  );
88  ISstream& ifs = ifsPtr();
89 
90  if (!ifs || !ifs.good())
91  {
92  FatalIOErrorInFunction(parentDict)
93  << "Included dictionary file " << fName
94  << " cannot be found for dictionary " << parentDict.name()
95  << exit(FatalIOError);
96  }
97 
98  read(ifs);
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
103 
105 {
106  return autoPtr<dictionary>(new dictionary(is));
107 }
108 
109 
110 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
111 
112 bool Foam::dictionary::read(Istream& is, const bool keepHeader)
113 {
114  // Check for empty dictionary
115  if (is.eof())
116  {
117  return true;
118  }
119 
120  if (!is.good())
121  {
123  << "Istream not OK for reading dictionary "
124  << exit(FatalIOError);
125 
126  return false;
127  }
128 
129  token currToken(is);
130  if (currToken != token::BEGIN_BLOCK)
131  {
132  is.putBack(currToken);
133  }
134 
135  while (!is.eof() && entry::New(*this, is))
136  {}
137 
138  // normally remove the FoamFile header entry if it exists
139  if (!keepHeader)
140  {
142  }
143 
144  if (is.bad())
145  {
147  << "Istream not OK after reading dictionary " << name()
148  << endl;
149 
150  return false;
151  }
152 
153  return true;
154 }
155 
156 
158 {
159  return false;
160 }
161 
162 
164 {
165  word varName = keyword(1, keyword.size()-1);
166 
167  // lookup the variable name in the given dictionary
168  const entry* ePtr = lookupEntryPtr(varName, true, true);
169 
170  // if defined insert its entries into this dictionary
171  if (ePtr != nullptr)
172  {
173  const dictionary& addDict = ePtr->dict();
174 
175  forAllConstIter(IDLList<entry>, addDict, iter)
176  {
177  add(iter());
178  }
179 
180  return true;
181  }
182 
183  return false;
184 }
185 
186 
187 
188 // * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * //
189 
191 {
192  // Reset input syntax as this is a "top-level" dictionary
194 
195  // Reset input mode assuming this is a "top-level" dictionary
197 
198  // Clear the cache of #calc include files
200 
201  dict.clear();
202  dict.name() = is.name();
203  dict.read(is);
204 
205  return is;
206 }
207 
208 
209 // * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * //
210 
212 {
213  if (subDict)
214  {
215  os << nl << indent << token::BEGIN_BLOCK << incrIndent << nl;
216  }
217 
218  forAllConstIter(IDLList<entry>, *this, iter)
219  {
220  const entry& e = *iter;
221 
222  // Write entry
223  os << e;
224 
225  // Add extra new line between entries for "top-level" dictionaries
226  if (!subDict && parent() == dictionary::null && (&e != last()))
227  {
228  os << nl;
229  }
230 
231  // Check stream before going to next entry.
232  if (!os.good())
233  {
235  << "Can't write entry " << iter().keyword()
236  << " for dictionary " << name()
237  << endl;
238  }
239  }
240 
241  if (subDict)
242  {
243  os << decrIndent << indent << token::END_BLOCK << endl;
244  }
245 }
246 
247 
249 {
250  dict.write(os, true);
251  return os;
252 }
253 
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 namespace Foam
258 {
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
263 unsetConfigEntries(const dictionary& configDict)
264 {
265  const wordRe unsetPattern("<.*>");
266  unsetPattern.compile();
267 
268  List<Tuple2<word, string>> unsetArgs;
269 
270  forAllConstIter(IDLList<entry>, configDict, iter)
271  {
272  if (iter().isStream())
273  {
274  ITstream& its = iter().stream();
275  OStringStream oss;
276  bool isUnset = false;
277 
278  forAll(its, i)
279  {
280  oss << its[i];
281  if (its[i].isWord() && unsetPattern.match(its[i].wordToken()))
282  {
283  isUnset = true;
284  }
285  }
286 
287  if (isUnset)
288  {
289  unsetArgs.append
290  (
292  (
293  iter().keyword(),
294  oss.str()
295  )
296  );
297  }
298  }
299  else
300  {
301  List<Tuple2<word, string>> subUnsetArgs =
302  unsetConfigEntries(iter().dict());
303 
304  forAll(subUnsetArgs, i)
305  {
306  unsetArgs.append
307  (
309  (
310  iter().keyword() + '/' + subUnsetArgs[i].first(),
311  subUnsetArgs[i].second()
312  )
313  );
314  }
315  }
316  }
317 
318  return unsetArgs;
319 }
320 
321 
323 (
324  const fileName& dir,
325  HashSet<word>& foMap
326 )
327 {
328  // Search specified directory for configuration files
329  {
330  fileNameList foFiles(fileHandler().readDir(dir));
331  forAll(foFiles, f)
332  {
333  if (foFiles[f].ext().empty())
334  {
335  foMap.insert(foFiles[f]);
336  }
337  }
338  }
339 
340  // Recurse into sub-directories
341  {
343  forAll(foDirs, fd)
344  {
345  listConfigFiles(dir/foDirs[fd], foMap);
346  }
347  }
348 }
349 
350 
351 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
352 
353 } // End namespace Foam
354 
355 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356 
358 (
359  const word& configName,
360  const fileName& configFilesPath,
361  const word& region
362 )
363 {
364  // First check if there is a configuration file in the
365  // region system directory
366  {
367  const fileName dictFile
368  (
369  stringOps::expandEnvVar("$FOAM_CASE")/"system"/region/configName
370  );
371 
372  if (isFile(dictFile))
373  {
374  return dictFile;
375  }
376  }
377 
378  // Next, if the region is specified, check if there is a configuration file
379  // in the global system directory
380  if (region != word::null)
381  {
382  const fileName dictFile
383  (
384  stringOps::expandEnvVar("$FOAM_CASE")/"system"/configName
385  );
386 
387  if (isFile(dictFile))
388  {
389  return dictFile;
390  }
391  }
392 
393  // Finally, check etc directories
394  {
395  const fileNameList etcDirs(findEtcDirs(configFilesPath));
396 
397  forAll(etcDirs, i)
398  {
399  const fileName dictFile(search(configName, etcDirs[i]));
400 
401  if (!dictFile.empty())
402  {
403  return dictFile;
404  }
405  }
406  }
407 
408  return fileName::null;
409 }
410 
411 
413 (
414  const fileName& configFilesPath
415 )
416 {
417  HashSet<word> foMap;
418 
419  fileNameList etcDirs(findEtcDirs(configFilesPath));
420 
421  forAll(etcDirs, ed)
422  {
423  listConfigFiles(etcDirs[ed], foMap);
424  }
425 
426  return foMap.sortedToc();
427 }
428 
429 
431 (
432  const word& configType,
433  const string& argString,
434  dictionary& parentDict,
435  const fileName& configFilesPath,
436  const Pair<string>& contextTypeAndValue,
437  const word& region
438 )
439 {
440  word funcType;
442  List<Tuple2<word, string>> namedArgs;
443 
444  dictArgList(argString, funcType, args, namedArgs);
445 
446  // Search for the configuration file
447  fileName path = findConfigFile(funcType, configFilesPath, region);
448 
449  if (path == fileName::null)
450  {
451  if (funcType == word::null)
452  {
453  FatalIOErrorInFunction(parentDict)
454  << "configuration file name not specified"
455  << nl << nl
456  << "Available configured objects:"
457  << listAllConfigFiles(configFilesPath)
458  << exit(FatalIOError);
459  }
460  else
461  {
462  FatalIOErrorInFunction(parentDict)
463  << "Cannot find configuration file "
464  << funcType << nl << nl
465  << "Available configured objects:"
466  << listAllConfigFiles(configFilesPath)
467  << exit(FatalIOError);
468  }
469 
470  return false;
471  }
472 
473  // Read the configuration file
474  autoPtr<ISstream> fileStreamPtr(fileHandler().NewIFstream(path));
475  ISstream& fileStream = fileStreamPtr();
476 
477  // Delay processing the functionEntries
478  // until after the argument entries have been added
480  dictionary funcsDict(fileName(funcType), parentDict, fileStream);
482 
483  dictionary* funcDictPtr = &funcsDict;
484 
485  if (funcsDict.found(funcType) && funcsDict.isDict(funcType))
486  {
487  funcDictPtr = &funcsDict.subDict(funcType);
488  }
489 
490  dictionary& funcDict = *funcDictPtr;
491 
492  // Store the funcDict as read for error reporting context
493  const dictionary funcDict0(funcDict);
494 
495  // Insert the 'field' and/or 'fields' and 'objects' entries corresponding
496  // to both the arguments and the named arguments
498  forAll(args, i)
499  {
501  }
502  forAll(namedArgs, i)
503  {
504  if (namedArgs[i].first() == "field")
505  {
506  IStringStream iss(namedArgs[i].second());
507  fieldArgs.append(wordAndDictionary(iss));
508  }
509  if
510  (
511  namedArgs[i].first() == "fields"
512  || namedArgs[i].first() == "objects"
513  )
514  {
515  IStringStream iss(namedArgs[i].second());
516  fieldArgs.append(List<wordAndDictionary>(iss));
517  }
518  }
519  if (fieldArgs.size() == 1)
520  {
521  funcDict.set("field", fieldArgs[0].first());
522  funcDict.merge(fieldArgs[0].second());
523  }
524  if (fieldArgs.size() >= 1)
525  {
526  funcDict.set("fields", fieldArgs);
527  funcDict.set("objects", fieldArgs);
528  }
529 
530  // Insert non-field arguments
531  forAll(namedArgs, i)
532  {
533  if
534  (
535  namedArgs[i].first() != "field"
536  && namedArgs[i].first() != "fields"
537  && namedArgs[i].first() != "objects"
538  && namedArgs[i].first() != "funcName"
539  && namedArgs[i].first() != "name"
540  )
541  {
542  const Pair<word> dAk(dictAndKeyword(namedArgs[i].first()));
543  dictionary& subDict(funcDict.scopedDict(dAk.first()));
544  IStringStream entryStream
545  (
546  dAk.second() + ' ' + namedArgs[i].second() + ';'
547  );
548  subDict.set(entry::New(entryStream).ptr());
549  }
550  }
551 
552  // Insert the region name if specified
553  if (region != word::null)
554  {
555  funcDict.set("region", region);
556  }
557 
558  // Set the name of the entry to that specified by the optional
559  // name argument otherwise automatically generate a unique name
560  // from the type and arguments
561  word entryName(string::validate<word>(argString));
562  forAll(namedArgs, i)
563  {
564  if
565  (
566  namedArgs[i].first() == "funcName"
567  || namedArgs[i].first() == "name"
568  )
569  {
570  entryName = namedArgs[i].second();
571  entryName.strip(" \n");
572  }
573  }
574 
575  // Check for anything in the configuration that has not been set
576  List<Tuple2<word, string>> unsetArgs = unsetConfigEntries(funcDict);
577  bool hasUnsetError = false;
578  forAll(unsetArgs, i)
579  {
580  if
581  (
582  unsetArgs[i].first() != "fields"
583  && unsetArgs[i].first() != "objects"
584  )
585  {
586  hasUnsetError = true;
587  }
588  }
589  if (!hasUnsetError)
590  {
591  forAll(unsetArgs, i)
592  {
593  funcDict.set(unsetArgs[i].first(), wordList());
594  }
595  }
596  else
597  {
598  FatalIOErrorInFunction(funcDict0)
599  << nl;
600 
601  forAll(unsetArgs, i)
602  {
603  FatalIOErrorInFunction(funcDict0)
604  << "Essential value for keyword '" << unsetArgs[i].first()
605  << "' not set" << nl;
606  }
607 
608  FatalIOErrorInFunction(funcDict0)
609  << nl << "In " << configType << " entry:" << nl
610  << " " << argString.c_str() << nl
611  << nl << "In " << contextTypeAndValue.first().c_str() << ":" << nl
612  << " " << contextTypeAndValue.second().c_str() << nl;
613 
614  word funcType;
616  List<Tuple2<word, string>> namedArgs;
617  dictArgList(argString, funcType, args, namedArgs);
618 
619  string argList;
620  forAll(args, i)
621  {
622  args[i].strip(" \n");
623  argList += (argList.size() ? ", " : "") + args[i];
624  }
625  forAll(namedArgs, i)
626  {
627  namedArgs[i].second().strip(" \n");
628  argList +=
629  (argList.size() ? ", " : "")
630  + namedArgs[i].first() + " = " + namedArgs[i].second();
631  }
632  forAll(unsetArgs, i)
633  {
634  unsetArgs[i].second().strip(" \n");
635  argList +=
636  (argList.size() ? ", " : "")
637  + unsetArgs[i].first() + " = " + unsetArgs[i].second();
638  }
639 
640  FatalIOErrorInFunction(funcDict0)
641  << nl << "The " << configType << " entry should be:" << nl
642  << " " << funcType << '(' << argList.c_str() << ')'
643  << exit(FatalIOError);
644  }
645 
646  // Re-parse the funcDict to execute the functionEntries
647  // now that the argument entries have been added
648  dictionary funcArgsDict;
649  funcArgsDict.add(entryName, funcDict);
650  {
651  OStringStream os;
652  funcArgsDict.write(os);
653  funcArgsDict = dictionary
654  (
655  funcType,
656  parentDict,
657  IStringStream(os.str())()
658  );
659  }
660 
661  // Merge this configuration dictionary into parentDict
662  parentDict.merge(funcArgsDict);
663  parentDict.subDict(entryName).name() = funcDict.name();
664 
665  return true;
666 }
667 
668 
669 // * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
670 
671 void Foam::writeEntry(Ostream& os, const dictionary& value)
672 {
673  os << value;
674 }
675 
676 
677 // ************************************************************************* //
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:477
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:78
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Definition: DynamicListI.H:296
A HashTable with keys but without contents.
Definition: HashSet.H:62
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:111
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Definition: HashTable.C:217
Template class for intrusive linked lists.
Definition: ILList.H:67
static constexpr const char * foamFile
Keyword for the FoamFile header sub-dictionary.
Definition: IOobject.H:104
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:294
bool bad() const
Return true if stream is corrupted.
Definition: IOstream.H:348
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:330
bool eof() const
Return true if end of input seen.
Definition: IOstream.H:336
Generic input stream.
Definition: ISstream.H:55
Input from memory buffer stream.
Definition: IStringStream.H:52
Input token stream.
Definition: ITstream.H:53
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
void putBack(const token &)
Put back token.
Definition: Istream.C:30
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
void append(const T &)
Append an element at the end of the list.
Definition: ListI.H:178
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
Output to memory buffer stream.
Definition: OStringStream.H:52
string str() const
Return the string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:65
const Type & second() const
Return second.
Definition: Pair.H:110
const Type & first() const
Return first.
Definition: Pair.H:98
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:63
T * last()
Return the last entry.
Definition: UILList.H:121
T * first()
Return the first entry.
Definition: UILList.H:109
T & first()
Return the first element of the list.
Definition: UListI.H:114
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:103
label size() const
Return the number of arguments.
Definition: argListI.H:90
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
const fileName & name() const
Return the dictionary name.
Definition: dictionary.H:109
includedDictionary(const fileName &fName, const dictionary &parentDict)
Construct an included dictionary for the given parent.
Definition: dictionaryIO.C:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
dictionary()
Construct top-level dictionary null.
Definition: dictionary.C:436
virtual bool global() const
Return true if the dictionary global,.
Definition: dictionaryIO.C:157
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:112
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:698
bool substituteKeyword(const word &keyword)
Substitute the given keyword prepended by '$' with the.
Definition: dictionaryIO.C:163
void set(entry *)
Assign a new entry, overwrite any existing entry.
Definition: dictionary.C:1307
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
Definition: dictionaryIO.C:211
bool remove(const word &)
Remove an entry specified by keyword.
Definition: dictionary.C:1332
bool isDict(const word &) const
Check if entry is a sub-dictionary.
Definition: dictionary.C:952
const dictionary & parent() const
Return the parent dictionary.
Definition: dictionary.H:320
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:998
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:1169
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:659
const dictionary & scopedDict(const word &) const
Find and return a sub-dictionary by scoped lookup.
Definition: dictionary.C:1093
static const dictionary null
Null dictionary.
Definition: dictionary.H:242
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Definition: dictionaryIO.C:104
bool merge(const dictionary &)
Merge entries from the given dictionary.
Definition: dictionary.C:1454
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:68
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
Definition: entryIO.C:92
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
static int disableFunctionEntries
Definition: entry.H:86
A class for handling file names.
Definition: fileName.H:82
static const fileName null
An empty fileName.
Definition: fileName.H:97
static void clear()
Reset the cache of #calc include file names.
static void clear()
Reset the inputMode to default (ie, merge)
static void clear()
Reset the inputSyntax to the default specified in etc/controlDict.
void strip(const string &)
Strip characters from the start and end of the string.
Definition: string.C:265
A token holds items read from Istream.
Definition: token.H:73
@ BEGIN_BLOCK
Definition: token.H:110
@ END_BLOCK
Definition: token.H:111
Tuple of a word and dictionary, used to read in per-field options for function objects in the followi...
A wordRe is a word, but can also have a regular expression for matching words.
Definition: wordRe.H:77
bool compile() const
Compile the regular expression.
Definition: wordReI.H:161
bool match(const std::string &, bool literalMatch=false) const
Smart match as regular expression or as a string.
Definition: wordReI.H:202
A class for handling words, derived from string.
Definition: word.H:62
static const word null
An empty word.
Definition: word.H:77
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:318
Functions to search 'etc' directories for configuration files etc.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
string expandEnvVar(const string &, const bool allowEmpty=false)
Expand all occurrences of environment variables and paths.
Definition: stringOps.C:241
Namespace for OpenFOAM.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
Definition: POSIX.C:555
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
List< word > wordList
A List of words.
Definition: fileName.H:54
const doubleScalar e
Definition: doubleScalar.H:105
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Definition: Ostream.H:235
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
void listConfigFiles(const fileName &dir, HashSet< word > &foMap)
Definition: dictionaryIO.C:323
void dictArgList(const string &argString, word &configName, wordReList &args, List< Tuple2< word, string >> &namedArgs)
Parse dictionary substitution argument list.
Definition: dictionary.C:1653
wordList listAllConfigFiles(const fileName &configFilesPath)
Return the list of configuration files in.
Definition: dictionaryIO.C:413
labelList second(const UList< labelPair > &p)
Definition: patchToPatch.C:49
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Definition: Ostream.H:228
bool readConfigFile(const word &configType, const string &argString, dictionary &parentDict, const fileName &configFilesPath, const Pair< string > &contextTypeAndValue, const word &region=word::null)
Read the specified configuration file.
Definition: dictionaryIO.C:431
Pair< word > dictAndKeyword(const word &scopedName)
Extracts dict name and keyword.
Definition: dictionary.C:1812
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
fileName findConfigFile(const word &configName, const fileName &configFilesPath, const word &region=word::null)
Search for configuration file for given region.
Definition: dictionaryIO.C:358
Istream & operator>>(Istream &, directionInfo &)
Foam::List< Foam::Tuple2< Foam::word, Foam::string > > unsetConfigEntries(const dictionary &configDict)
Definition: dictionaryIO.C:263
IOerror FatalIOError
fileNameList findEtcDirs(const fileName &local=fileName::null)
Search for directories from user/group/shipped directories.
Definition: etcFiles.C:32
Ostream & operator<<(Ostream &, const ensightPart &)
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:221
static const char nl
Definition: Ostream.H:260
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Definition: POSIX.C:662
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
labelList f(nPoints)
dictionary dict
Foam::argList args(argc, argv)