34 namespace TableReaders
42 if (componentColumns_[0] >= split.
size())
45 <<
"No column " << componentColumns_[0] <<
" in " 57 if (componentColumns_[0] >= split.
size())
60 <<
"No column " << componentColumns_[0] <<
" in " 74 for(
label i = 0;i < pTraits<Type>::nComponents; i++)
76 if (componentColumns_[i] >= split.
size())
79 <<
"No column " << componentColumns_[i] <<
" in " 110 for (
label i = 0; i < nHeaderLine_; i++)
116 const label nEntries =
max(refColumn_,
max(componentColumns_));
128 if (mergeSeparators_)
130 std::size_t nPos = 0;
132 while ((pos != std::string::npos) && (n <= nEntries))
137 nPos = line.find(separator_, pos);
139 if ((nPos != std::string::npos) && (nPos - pos == 0))
149 nPos = line.find(separator_, pos);
151 if (nPos == std::string::npos)
153 split.
append(line.substr(pos));
159 split.
append(line.substr(pos, nPos - pos));
167 while ((pos != std::string::npos) && (n <= nEntries))
169 std::size_t nPos = line.find(separator_, pos);
171 if (nPos == std::string::npos)
173 split.
append(line.substr(pos));
179 split.
append(line.substr(pos, nPos - pos));
186 if (split.
size() <= 1)
192 Type value = readValue(split);
220 componentColumns_(dict.
lookup(
"componentColumns")),
221 separator_(dict.lookupOrDefault<
string>(
"separator",
string(
","))[0]),
227 << componentColumns_ <<
" does not have the expected length " 251 writeEntry(os,
"componentColumns", componentColumns_);
256 writeEntry(os,
"componentColumns", componentColumns_);
258 writeEntry(os,
"separator",
string(separator_));
259 writeEntry(os,
"mergeSeparators", mergeSeparators_);
Base class to read table data for tables.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of different types.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
void transfer(dictionary &)
Transfer the contents of the argument and annul the argument.
virtual void write(Ostream &os) const
Write the remaining parameters.
bool good() const
Return true if next operation might succeed.
Reads an interpolation table from a file in CSV-format. Entries govern the layout of the CSV file...
virtual ~Csv()
Destructor.
dimensionedScalar pos(const dimensionedScalar &ds)
Csv(const dictionary &dict)
Construct from dictionary.
stressControl lookup("compactNormalStress") >> compactNormalStress
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
streamFormat format() const
Return current stream format.
label readLabel(Istream &is)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Database for solution and other reduced data.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
virtual void write(Ostream &os) const
Write additional information.
Input from memory buffer stream.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
A class for handling character strings derived from std::string.
ISstream & getLine(string &)
Read line into a string.