mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
STYLE: relegate special purpose readList<T> function to points of use
- the readList<T>(Istream&) function was introduced to handle command
-options with either a single or a list value, but was also used for
the #remove dictionary directive. However, the parsing was fragile
if the list did not start with a '('.
Now handle command-line arg/option list directly (via ITstream)
and #remove with special-purpose reading of a string or word list.
This removes ambiguity and reduces potential future problems.
STYLE: use ITstream instead of IStringStream for command-line lookups
- parses directly to a tokenList without a string copy.
This commit is contained in:
@ -67,9 +67,6 @@ class functionEntry
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Read line as string token
|
||||
static token readLine(const word& key, Istream& is);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
functionEntry(const functionEntry&) = delete;
|
||||
|
||||
@ -77,6 +74,16 @@ class functionEntry
|
||||
void operator=(const functionEntry&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Read line and return as a string token
|
||||
static token readLine(const word& key, Istream& is);
|
||||
|
||||
//- Read a List of strings values, treating a single entry like a
|
||||
//- list of size 1.
|
||||
template<class StringType>
|
||||
static List<StringType> readStringList(Istream& is);
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
@ -142,6 +149,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "functionEntryTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user