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:
Mark Olesen
2017-11-26 12:45:49 +01:00
parent 5947f9a337
commit 2787a8664d
10 changed files with 115 additions and 71 deletions

View File

@ -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
// ************************************************************************* //