Relacs
0.9.8
|
#include <tablekey.h>
Public Member Functions | |
TableKey (void) | |
TableKey (const TableKey &key) | |
TableKey (const Options &o) | |
~TableKey (void) | |
Parameter & | addNumber (const string &name, const string &unit="", const string &format="", int flags=0, double value=0.0) |
Parameter & | addNumber (const string &name, const string &unit, const string &format, double value, int flags=0) |
Parameter & | insertNumber (const string &name, const string &atname="", const string &unit="", const string &format="", int flags=0) |
Parameter & | setNumber (const string &name, double number, const string &unit="") |
Parameter & | setInteger (const string &name, long number, const string &unit="") |
Parameter & | addText (const string &name, const string &format="", int flags=0, const string &value="") |
Parameter & | addText (const string &name, const string &format, const string &value, int flags=0) |
Parameter & | addText (const string &name, int width, int flags=0, const string &value="") |
Parameter & | addText (const string &name, int width, const string &value, int flags=0) |
Parameter & | insertText (const string &name, const string &atname="", const string &format="", int flags=0) |
Parameter & | insertText (const string &name, const string &atname, int width, int flags=0) |
Parameter & | setText (const string &name, const string &text) |
Options & | newSection (int level, const string &name, int flags=0) |
Options & | newSection (const string &name, int flags=0) |
Options & | newSubSection (const string &name, int flags=0) |
Options & | newSubSubSection (const string &name, int flags=0) |
Options & | insertSection (const string &name, const string &atname="", int flags=0) |
Options & | newSection (int level, const Options &opt, int selectmask=0, const string &name="", int flag=0) |
Options & | newSection (const Options &opt, int selectmask=0, const string &name="", int flag=0) |
Options & | newSubSection (const Options &opt, int selectmask=0, const string &name="", int flag=0) |
Options & | newSubSubSection (const Options &opt, int selectmask=0, const string &name="", int flag=0) |
void | add (const Options &opts, int selectflag=0) |
void | insert (const Options &opts, const string &atname="") |
void | insert (const Options &opts, int selectflag, const string &atname="") |
void | erase (int column) |
void | erase (const string &pattern) |
int | column (const string &pattern) const |
int | operator() (const string &pattern) const |
Str | name (int column) const |
Str | name (const string &pattern) const |
Parameter & | setName (int column, const string &name) |
Parameter & | setName (const string &pattern, const string &name) |
Str | unit (int column) const |
Str | unit (const string &pattern) const |
Parameter & | setUnit (int column, const string &unit) |
Parameter & | setUnit (const string &pattern, const string &unit) |
Str | format (int column) const |
Str | format (const string &pattern) const |
int | formatWidth (int column) const |
int | formatWidth (const string &pattern) const |
Parameter & | setFormat (int column, const string &format) |
Parameter & | setFormat (const string &pattern, const string &format) |
bool | isNumber (int column) const |
bool | isNumber (const string &pattern) const |
bool | isText (int column) const |
bool | isText (const string &pattern) const |
Str | sectionName (int column, int level=1) const |
Str | sectionName (const string &pattern, int level=1) const |
void | setSectionName (int column, const string §ion, int level=1) |
void | setSectionName (const string &pattern, const string §ion, int level=1) |
const Options & | subSection (int column, int level=1) const |
Options & | subSection (int column, int level=1) |
const Options & | subSection (const string &pattern, int level=1) const |
Options & | subSection (const string &pattern, int level=1) |
const Parameter & | operator[] (int i) const |
Parameter & | operator[] (int i) |
const Parameter & | operator[] (const string &pattern) const |
Parameter & | operator[] (const string &pattern) |
int | columns (void) const |
int | level (void) const |
bool | empty (void) const |
void | clear (void) |
ostream & | saveKey (ostream &str, bool key=true, bool num=true, bool units=true, int flags=0) const |
ostream & | saveKeyLaTeX (ostream &str, bool num=true, bool units=true, int flags=0) const |
ostream & | saveKeyHTML (ostream &str, bool num=true, bool units=true, int flags=0) const |
TableKey & | loadKey (const StrQueue &sq) |
ostream & | saveData (ostream &str) |
ostream & | saveData (ostream &str, int from, int to) |
ostream & | saveMetaData (ostream &str, const string &start="") const |
ostream & | save (ostream &str, double v, int c=-1) const |
template<typename T > | |
ostream & | save (ostream &str, const T *v, int n, int c=-1) const |
ostream & | save (ostream &str, const vector< double > &vec, int c=-1) const |
ostream & | save (ostream &str, const vector< float > &vec, int c=-1) const |
template<typename T > | |
ostream & | save (ostream &str, const Array< T > &vec, int c=-1) const |
template<typename T > | |
ostream & | save (ostream &str, const vector< vector< T > > &v, int r, int c=0) const |
template<typename T > | |
ostream & | save (ostream &str, const vector< Array< T > > &v, int r, int c=0) const |
ostream & | save (ostream &str, const TableData &table, int r, int c=-1) const |
ostream & | save (ostream &str, const TableData &table, int r, int cbegin, int cend, int c=-1) const |
ostream & | save (ostream &str, const TableData &table) const |
ostream & | save (ostream &str, const char *text, int c=-1) const |
ostream & | save (ostream &str, const string &text, int c=-1) const |
ostream & | save (ostream &str, const Parameter ¶m, int c=-1) const |
void | saveSkip (void) const |
int | saveColumn (void) const |
void | setSaveColumn (int col) |
void | resetSaveColumn (void) |
string | comment (void) const |
void | setComment (const string &comment) |
string | keyStart (void) const |
void | setKeyStart (const string &start) |
string | dataStart (void) const |
void | setDataStart (const string &start) |
string | separator (void) const |
void | setSeparator (const string &separator) |
string | missing (void) const |
void | setMissing (const string &missing) |
Friends | |
ostream & | operator<< (ostream &str, const TableKey &tk) |
Handling a table header.
~TableKey | ( | void | ) |
Destructor.
References TableKey::clear().
Parameter & addNumber | ( | const string & | name, |
const string & | unit = "" , |
||
const string & | format = "" , |
||
int | flags = 0 , |
||
double | value = 0.0 |
||
) |
Add a new column for numbers with name name() and value value to the key. The column has a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).
References Options::addNumber().
Referenced by TableKey::loadKey(), and PlotTrace::print().
Parameter & addNumber | ( | const string & | name, |
const string & | unit, | ||
const string & | format, | ||
double | value, | ||
int | flags = 0 |
||
) |
Add a new column with name name() and value value to the key. The column has a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).
References Options::addNumber().
Parameter & insertNumber | ( | const string & | name, |
const string & | atname = "" , |
||
const string & | unit = "" , |
||
const string & | format = "" , |
||
int | flags = 0 |
||
) |
Insert a new column for numbers with name name() and value value() at the beginning of the key (atindent == "") or at the position of the column with name atname. If the column with name atname does not exist, the column is appended to the end of the key. The column has a unit unit and a format string format (ANSI C printf() syntax, only %g, %f, %e are allowed, since the number is a double).
References Options::insertNumber().
Parameter & setNumber | ( | const string & | name, |
double | number, | ||
const string & | unit = "" |
||
) |
Set the value of an existing colum with name name to number.
References TableKey::operator[](), and Parameter::setNumber().
Parameter & setInteger | ( | const string & | name, |
long | number, | ||
const string & | unit = "" |
||
) |
Set the value of an existing column with name name to number.
References TableKey::operator[](), and Parameter::setInteger().
Parameter & addText | ( | const string & | name, |
const string & | format = "" , |
||
int | flags = 0 , |
||
const string & | value = "" |
||
) |
Add a new column for strings with name name() and value value to the key. The column has a format string format (ANSI C printf() syntax, only %s) and its unit is set to '-'.
References Options::addText(), Parameter::setFormat(), and Parameter::setUnit().
Parameter & addText | ( | const string & | name, |
const string & | format, | ||
const string & | value, | ||
int | flags = 0 |
||
) |
Add a new column for strings with name name() and value value to the key. The column has a format string format (ANSI C printf() syntax, only %s) and its unit is set to '-'.
References Options::addText(), Parameter::setFormat(), and Parameter::setUnit().
Parameter & addText | ( | const string & | name, |
int | width, | ||
int | flags = 0 , |
||
const string & | value = "" |
||
) |
Add a new column for strings with name name() and value value to the key. The unit is set to '-'. The column is formatted to a abs
( width
) long string. If width is positive then the string is aligned to the right, if width is positive it is aligned to the left.
References Options::addText(), Parameter::setFormat(), and Parameter::setUnit().
Parameter & addText | ( | const string & | name, |
int | width, | ||
const string & | value, | ||
int | flags = 0 |
||
) |
Add a new column for strings with name name() and value value to the key. The unit is set to '-'. The column is formatted to a abs
( width
) long string. If width is positive then the string is aligned to the right, if width is positive it is aligned to the left.
References Options::addText(), Parameter::setFormat(), and Parameter::setUnit().
Parameter & insertText | ( | const string & | name, |
const string & | atname = "" , |
||
const string & | format = "" , |
||
int | flags = 0 |
||
) |
Insert a new column for strings with name name() and value value at the beginning of the key (atindent == "") or at the position of the column with name atname. If the column with name atname does not exist, the column is appended to the end of the key. The column has a format string format (ANSI C printf() syntax, only %s) and its unit is set to '-'.
References Options::insertText(), Parameter::setFormat(), and Parameter::setUnit().
Parameter& insertText | ( | const string & | name, |
const string & | atname, | ||
int | width, | ||
int | flags = 0 |
||
) |
Insert a new column for strings with name name() and value value at the beginning of the key (atindent == "") or at the position of the column with name atname. If the column with name atname does not exist, the column is appended to the end of the key. The unit is set to '-'. The column is formatted to a abs
( width
) long string. If width is positive then the string is aligned to the right, if width is positive it is aligned to the left.
Parameter & setText | ( | const string & | name, |
const string & | text | ||
) |
Set the value of an existing tet column with name name to text.
References TableKey::operator[](), and Parameter::setText().
Options & newSection | ( | int | level, |
const string & | name, | ||
int | flags = 0 |
||
) |
Add a new section name with level level to the key. level = 0 is the top-level section. Subsequent calls to addNumber() adds columns to this section.
References Options::newSection().
Referenced by TableKey::loadKey().
Options & newSection | ( | const string & | name, |
int | flags = 0 |
||
) |
Add a new top-level section name to the key. Subsequent calls to addNumber() adds columns to this section.
References Options::newSection().
Options & newSubSection | ( | const string & | name, |
int | flags = 0 |
||
) |
Add a new second-level section name to the key. Subsequent calls to addNumber() adds columns to this section.
References Options::newSubSection().
Options & newSubSubSection | ( | const string & | name, |
int | flags = 0 |
||
) |
Add a new third-level section name to the key. Subsequent calls to addNumber() adds columns to this section.
References Options::newSubSubSection().
Options & insertSection | ( | const string & | name, |
const string & | atname = "" , |
||
int | flags = 0 |
||
) |
Insert a new section of columns before the section specified by atpattern. If atpattern is not found or if atname is empty, the new section is added to the beginning or the end of the currently active section, respectively. The new section is named name and has some flag for selecting this section. Subsequent calls to addNumber() adds columns to the inserted section.
References Options::insertSection().
Options & newSection | ( | int | level, |
const Options & | opt, | ||
int | selectmask = 0 , |
||
const string & | name = "" , |
||
int | flag = 0 |
||
) |
Add opt as a new subsection of level level. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. flag is added to the new section's flag, respectively. level = 0 is the upper level, i.e. a new section is added. Higher levels add sections lower in the hierachy, i.e. level = 1 adds a subsection, level = 2 a subsubsection, etc. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.
References Options::newSection().
Options & newSection | ( | const Options & | opt, |
int | selectmask = 0 , |
||
const string & | name = "" , |
||
int | flag = 0 |
||
) |
Add opt as a new section to the end of this section list. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. flag is added to the new section's flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.
References Options::newSection().
Options & newSubSection | ( | const Options & | opt, |
int | selectmask = 0 , |
||
const string & | name = "" , |
||
int | flag = 0 |
||
) |
Add opt as a new subsection to the last section. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. flag is added to the new section's flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.
References Options::newSubSection().
Options & newSubSubSection | ( | const Options & | opt, |
int | selectmask = 0 , |
||
const string & | name = "" , |
||
int | flag = 0 |
||
) |
Add opt as a new subsubsection to the last subsection of the last section. Only name-value pairs and sections as specified by selectmask are taken from opt. If name is not an empty string, the name of the new section is set to name. flag are added to the new section's flag. Subsequent calls to addText(), addNumber(), etc. add new Parameter to the added section.
References Options::newSubSubSection().
void add | ( | const Options & | opts, |
int | selectflag = 0 |
||
) |
Adds all Parameters and sections from opts to the key as specified by selectflag.
References Options::append().
void insert | ( | const Options & | opts, |
const string & | atname = "" |
||
) |
Insert all Parameters and sections from opts at the beginning of the key (atname == "") or at the position of the column or section specifier with name atname. If the column or section with name atname does not exist, the options are appended to the end of the key.
References Options::insert().
void insert | ( | const Options & | opts, |
int | selectflag, | ||
const string & | atname = "" |
||
) |
Insert all Parameter and sections from opts as specified by selectflag at the beginning of the key (atname == "") or at the position of the column or section specifier with name atname. If the column or section with name atname does not exist, the options are appended to the end of the key.
References Options::insert().
void erase | ( | int | column | ) |
Erase the column column from the key.
References TableKey::column(), Options::empty(), Options::erase(), and Options::parentSection().
void erase | ( | const string & | pattern | ) |
Erase the column whose name string matches pattern from the key.
References Options::erase().
int column | ( | const string & | pattern | ) | const |
Returns the column whose name string matches pattern. The first column is 0.
References Options::end(), Options::find(), Options::findSection(), and Options::sectionsEnd().
Referenced by DataFile::column(), TableKey::erase(), TableKey::format(), TableKey::formatWidth(), TableKey::isNumber(), TableKey::isText(), DataIndex::DataItem::loadCell(), DataIndex::loadDirectory(), TableKey::name(), TableKey::operator[](), TableKey::sectionName(), TableKey::setFormat(), TableKey::setName(), TableKey::setSectionName(), TableKey::setUnit(), TableKey::subSection(), relacs::translate(), and TableKey::unit().
|
inline |
Returns the column whose name string matches pattern. The first column is 0.
Str name | ( | int | column | ) | const |
Returns the name string of the column-th column.
Referenced by PlotTrace::displayIndex(), TableKey::loadKey(), TableKey::name(), TableKey::saveKey(), TableKey::saveKeyHTML(), and TableKey::saveKeyLaTeX().
Str name | ( | const string & | pattern | ) | const |
Returns the name string of the column specified by pattern.
References TableKey::column(), and TableKey::name().
Parameter & setName | ( | int | column, |
const string & | name | ||
) |
Set the name string of the column-th column to name.
Referenced by TableKey::setName(), and TableKey::setSectionName().
Parameter & setName | ( | const string & | pattern, |
const string & | name | ||
) |
Set the name string of the column specified by pattern to name.
References TableKey::column(), and TableKey::setName().
Str unit | ( | int | column | ) | const |
Returns the unit of the column-th column.
Referenced by PlotTrace::displayIndex(), TableKey::loadKey(), TableKey::saveKey(), TableKey::saveKeyHTML(), TableKey::saveKeyLaTeX(), and TableKey::unit().
Str unit | ( | const string & | pattern | ) | const |
Returns the unit of the column specified by pattern.
References TableKey::column(), and TableKey::unit().
Parameter & setUnit | ( | int | column, |
const string & | unit | ||
) |
Set the unit of the column-th column to unit.
Referenced by TableKey::setUnit().
Parameter & setUnit | ( | const string & | pattern, |
const string & | unit | ||
) |
Set the unit of the column specified by pattern to unit.
References TableKey::column(), and TableKey::setUnit().
Str format | ( | int | column | ) | const |
Returns the format string of the column-th column.
Referenced by TableKey::format(), and TableKey::save().
Str format | ( | const string & | pattern | ) | const |
Returns the format string of the column specified by pattern.
References TableKey::column(), and TableKey::format().
int formatWidth | ( | int | column | ) | const |
Returns the width defined in the format string of the column-th column.
Referenced by TableKey::formatWidth(), and TableKey::save().
int formatWidth | ( | const string & | pattern | ) | const |
Returns the width defined in the format string of the column specified by pattern.
References TableKey::column(), and TableKey::formatWidth().
Parameter & setFormat | ( | int | column, |
const string & | format | ||
) |
Set the format string of the column-th column to format.
Referenced by TableKey::setFormat().
Parameter & setFormat | ( | const string & | pattern, |
const string & | format | ||
) |
Set the format string of the column specified by pattern to format.
References TableKey::column(), and TableKey::setFormat().
bool isNumber | ( | int | column | ) | const |
Returns true
if the column column contains numbers.
Referenced by TableKey::isNumber().
bool isNumber | ( | const string & | pattern | ) | const |
Returns true
if the column specified by pattern contains numbers.
References TableKey::column(), and TableKey::isNumber().
bool isText | ( | int | column | ) | const |
Returns true
if the column column contains strings.
Referenced by TableKey::isText(), TableKey::save(), and TableKey::saveData().
bool isText | ( | const string & | pattern | ) | const |
Returns true
if the column specified by pattern contains strings.
References TableKey::column(), and TableKey::isText().
Str sectionName | ( | int | column, |
int | level = 1 |
||
) | const |
Returns the section name string of level level for the column-th column. level = 0 returns the name string of the column.
References TableKey::column().
Referenced by DataIndex::DataItem::loadCell(), DataIndex::loadDirectory(), and TableKey::sectionName().
Str sectionName | ( | const string & | pattern, |
int | level = 1 |
||
) | const |
Returns the section name string of level level for the column specified by pattern. level = 0 returns the name string of the column.
References TableKey::column(), and TableKey::sectionName().
void setSectionName | ( | int | column, |
const string & | section, | ||
int | level = 1 |
||
) |
Set the section name string of level level for the column-th column to section. level = 0 sets the name string of the column.
References TableKey::column(), and TableKey::setName().
Referenced by TableKey::setSectionName().
void setSectionName | ( | const string & | pattern, |
const string & | section, | ||
int | level = 1 |
||
) |
Set the section name string of level level for the column specified by pattern to section. level = 0 sets the name string of the column.
References TableKey::column(), and TableKey::setSectionName().
const Options & subSection | ( | int | column, |
int | level = 1 |
||
) | const |
Returns the section at column column and level level with all its subsections and column labels. level = 0 returns an empty Options.
References Options::clear(), and TableKey::column().
Referenced by TableKey::subSection().
Options & subSection | ( | int | column, |
int | level = 1 |
||
) |
References Options::clear(), and TableKey::column().
const Options & subSection | ( | const string & | pattern, |
int | level = 1 |
||
) | const |
Returns the section at the column specified by pattern and level level with all its subsections and column labels. level = 0 returns an empty Options.
References TableKey::column(), and TableKey::subSection().
Options & subSection | ( | const string & | pattern, |
int | level = 1 |
||
) |
References TableKey::column(), and TableKey::subSection().
const Parameter & operator[] | ( | int | i | ) | const |
Get i-th column.
Referenced by TableKey::operator[](), TableKey::setInteger(), TableKey::setNumber(), and TableKey::setText().
Parameter & operator[] | ( | int | i | ) |
Get i-th column.
const Parameter & operator[] | ( | const string & | pattern | ) | const |
Get the column specified by pattern.
References TableKey::column(), and TableKey::operator[]().
Parameter & operator[] | ( | const string & | pattern | ) |
Get the column specified by pattern.
References TableKey::column(), and TableKey::operator[]().
int columns | ( | void | ) | const |
The number of columns the TableKey describes.
Referenced by PlotTrace::displayIndex(), TableKey::save(), and TableData::TableData().
int level | ( | void | ) | const |
The number of levels of the TableKey. 0: No columns are described by the TableKey, 1: Each column has an name, but columns are not grouped in sections. 2: Columns are grouped in sections. 3: Groups of columns are grouped in sections ...
Referenced by TableKey::loadKey().
bool empty | ( | void | ) | const |
Returns true if the TableKey does not describe any columns. However, it can already contain descriptions of sections.
void clear | ( | void | ) |
Clears the TableKey. Erases all column and section descriptions.
References Options::clear().
Referenced by DataFile::close(), DataFile::key(), TableKey::loadKey(), SaveFiles::RelacsFiles::RelacsFiles(), and TableKey::~TableKey().
ostream & saveKey | ( | ostream & | str, |
bool | key = true , |
||
bool | num = true , |
||
bool | units = true , |
||
int | flags = 0 |
||
) | const |
Write the table header to str. If key equals true, it is preceded by a line "Key". If num equals true, a line indicating the column numbers is added. If units equals true, a line indicating the units for the column entries is added. Each line is preceded by the KeyStart string.
References TableKey::name(), Str::strip(), and TableKey::unit().
Referenced by relacs::operator<<(), and PlotTrace::print().
ostream & saveKeyLaTeX | ( | ostream & | str, |
bool | num = true , |
||
bool | units = true , |
||
int | flags = 0 |
||
) | const |
Write the table header as a LaTeX table header to str. If num equals true, a line indicating the column numbers is added. If units equals true, a line indicating the units for the column entries is added.
References Str::empty(), Str::latex(), TableKey::name(), and TableKey::unit().
ostream & saveKeyHTML | ( | ostream & | str, |
bool | num = true , |
||
bool | units = true , |
||
int | flags = 0 |
||
) | const |
Write the table header as a HTML table header to str. If num equals true, a line indicating the column numbers is added. If units equals true, a line indicating the units for the column entries is added.
References Str::empty(), Str::html(), TableKey::name(), and TableKey::unit().
Load the table header from sq.
References relacs::abs(), TableKey::addNumber(), TableKey::clear(), TableKey::comment(), Str::DoubleWhiteSpace, Str::first(), relacs::floor(), TableKey::level(), relacs::log10(), TableKey::name(), TableKey::newSection(), Str::strip(), TableKey::unit(), and Str::wordAt().
Referenced by DataFile::key().
ostream & saveData | ( | ostream & | str | ) |
Write the data stored in the TableKey as one line of the table to str. These are the data that were set with setNumber() or setText().
References Str::empty(), TableKey::isText(), and Str::size().
ostream & saveData | ( | ostream & | str, |
int | from, | ||
int | to | ||
) |
Write the data stored in the TableKey columns from to to as one line of the table to str (no trailing newline). These are the data that were set with setNumber() or setText().
References Str::empty(), TableKey::isText(), and Str::size().
ostream & saveMetaData | ( | ostream & | str, |
const string & | start = "" |
||
) | const |
Write the data stored in the TableKey to str. Each datum is written into a separate line and is preceeded by its name. Each line is started with start. These are the data that were set with setNumber().
References Options::save().
ostream & save | ( | ostream & | str, |
double | v, | ||
int | c = -1 |
||
) | const |
Write the number v to the output stream str using the format for column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the number. If the output column does not exist, nothing is written to str.
References TableKey::format(), and Str::size().
Referenced by PlotTrace::print(), and TableKey::save().
ostream & save | ( | ostream & | str, |
const T * | v, | ||
int | n, | ||
int | c = -1 |
||
) | const |
Write the n numbers v to the output stream str using the formats starting at column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
References Str::size().
|
inline |
Write the numbers of the vector vec to the output stream str using the formats starting at column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, Start, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
|
inline |
ostream & save | ( | ostream & | str, |
const Array< T > & | vec, | ||
int | c = -1 |
||
) | const |
References Array< T >::begin(), Array< T >::end(), and Str::size().
ostream & save | ( | ostream & | str, |
const vector< vector< T > > & | v, | ||
int | r, | ||
int | c = 0 |
||
) | const |
Write the numbers of the row r of v to the output stream str using the formats starting at column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
References Str::size().
ostream & save | ( | ostream & | str, |
const vector< Array< T > > & | v, | ||
int | r, | ||
int | c = 0 |
||
) | const |
Write the numbers of the row r of v to the output stream str using the formats starting at column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
References Str::size().
ostream & save | ( | ostream & | str, |
const TableData & | table, | ||
int | r, | ||
int | c = -1 |
||
) | const |
Write the numbers of the row r of table to the output stream str using the formats starting at column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
References TableData::columns(), TableKey::format(), and TableData::rows().
ostream & save | ( | ostream & | str, |
const TableData & | table, | ||
int | r, | ||
int | cbegin, | ||
int | cend, | ||
int | c = -1 |
||
) | const |
Write the numbers from colum cbegin to column cend (exclusively) of the row r of table to the output stream str using the formats starting at column c. If cend is negative, it is set behind the last column of the table. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the numbers. The numbers are separeted by Separator. If an output column does not exist, it is not written to str.
References TableData::columns(), TableKey::format(), and TableData::rows().
ostream & save | ( | ostream & | str, |
const TableData & | table | ||
) | const |
Write the whole table table to the output stream str using the formats of the TableKey. DataStart is written at the beginning of each line and Separator is written between the numbers. If an output column does not exist, it is not written to str.
References TableData::columns(), TableKey::columns(), TableKey::format(), TableData::rows(), and Str::size().
ostream & save | ( | ostream & | str, |
const char * | text, | ||
int | c = -1 |
||
) | const |
Write the string text to the output stream str using the format for column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the string. If the output column does not exist, nothing is written to str. If text is empty, the missing-string is written instead ( see setMissing() ). The whole string is written, even if it is longer than the width of the column!
References TableKey::save().
ostream & save | ( | ostream & | str, |
const string & | text, | ||
int | c = -1 |
||
) | const |
Write the string text to the output stream str using the format for column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the string. If the output column does not exist, nothing is written to str. If text is empty, the missing-string is written instead ( see setMissing() ). The whole string is written, even if it is longer than the width of the column!
References TableKey::format(), TableKey::formatWidth(), TableKey::isText(), and Str::size().
ostream & save | ( | ostream & | str, |
const Parameter & | param, | ||
int | c = -1 |
||
) | const |
Write the Parameter param to the output stream str using the format for column c. If c is negative, the output column is set to the column following the one used in the most recent call of one of the save() functions. If the output column is the first column, DataStart, otherwise Separator is written right before the string. If the output column does not exist, nothing is written to str.
References Str::empty(), TableKey::format(), TableKey::formatWidth(), Parameter::isText(), Str::size(), and Parameter::text().
|
inline |
Skip one column of automatically formatted output. Nothing is written, just the current column is incremented.
|
inline |
Return the column number of the last output via one of the save() functions.
void setSaveColumn | ( | int | col | ) |
Set the column number of the last output to col.
void resetSaveColumn | ( | void | ) |
Reset the column number such that the next save() function writes into the first column.
string comment | ( | void | ) | const |
The string indicating a comment.
Referenced by TableKey::loadKey(), and TableKey::setComment().
void setComment | ( | const string & | comment | ) |
Set the string for indicating comments to comment and the start string to comment + " ".
References TableKey::comment().
string keyStart | ( | void | ) | const |
The string introducing each line of the table header.
void setKeyStart | ( | const string & | start | ) |
Set the string introducing each line of the table header to start.
string dataStart | ( | void | ) | const |
The string introducing each line of data.
void setDataStart | ( | const string & | start | ) |
Set the string introducing each line of data to start.
string separator | ( | void | ) | const |
The string separating two columns.
Referenced by TableKey::setSeparator().
void setSeparator | ( | const string & | separator | ) |
Set the string separating two columns to separator.
References TableKey::separator().
string missing | ( | void | ) | const |
The string indicating a missing data value.
Referenced by TableKey::setMissing().
void setMissing | ( | const string & | missing | ) |
Set the string indicating missing data values to missing.
References TableKey::missing().
|
friend |
Write the table header to str using saveKey() with the default settings.