relacs Namespace Reference


Classes

class  DataFile
 Reading Ascii Data Files. More...
class  TableData
 Table for number and strings. More...
class  TableKey
 Handling a table header. More...

Functions

ostream & operator<< (ostream &str, const TableKey &tk)
Str translate (const Str &s, vector< Options > &opt, const string &ts, const string &dflt, const TableKey *tkey)
Str translate (const Str &s, Options &opt, const string &dflt)
void translate (const StrQueue &sq, StrQueue &dq, vector< Options > &opt, const string &ts, const string &dflt, const TableKey *tkey)


Function Documentation

ostream& relacs::operator<< ( ostream &  str,
const TableKey &  tk 
)

Write the table header to str using saveKey() with the default settings.

Str translate ( const Str &  s,
vector< Options > &  opt,
const string &  ts = "",
const string &  dflt = "",
const TableKey *  tkey = 0 
)

Returns the string s with each occurence of a pattern substituted by the value of the identifier xxxx found in one of the options opt. A pattern of the form $(o xxxx) searches xxxx in the options opt that corresponds to the character o in ts. The first character in ts refers to the first options in opt, the second character to the second option, and so on. If tkey is not null then the last character in ts refers to the table key tkey. For example, if ts = "pst" and the pattern is $(s xxx) then xxx is searched in the second options in opt. If ts is not specified, then it is set to "0123456789". In addition a format string fff and a unit uuu can be specified that is separated from the search string xxx by a single white space: $(fffuuu xxxx) $(offfuuu xxx). The format string starts with '' followed by the width, the precision and the conversion specifier, like for the printf function in C. For example: $(%.3fkHz frequency). See Parameter::text() for a complete list of format specifiers. A default string is specified with ':' directly following the format and unit. For example: $(%.3fkHz:10 frequency) would use '10' as the default string if 'frequency' is not found in opt. If the specified default string contains blank spaces, you need to enclose it with '"': $(:"no value found" frequency) If no default string is explicitly specified in the search pattern dflt is used. A pattern refering to a table key tkey returns the corresponding column number (0 corresponds to the first column, if the format string equals '+', then 1 corresponds to the first column. If the format string equals "+nn", where nn is some integer, then nn corresponds to the first column. For example: ts="123k" $(k population>mean) returns the column number of the column labeled "population>mean" (see TableKey::column() for details of column labels).

Str translate ( const Str &  s,
Options &  opt,
const string &  dflt 
)

void translate ( const StrQueue &  sq,
StrQueue &  dq,
vector< Options > &  opt,
const string &  ts = "",
const string &  dflt = "",
const TableKey *  tkey = 0 
)

Returns in dq the StrQueue sq with each occurence of a pattern substituted by the value of the identifier xxxx found in one of the options opt. A pattern of the form $(o xxxx) searches xxxx in the options opt that corresponds to the character o in ts. The first character in ts refers to the first options in opt, the second character to the second option, and so on. For example, if ts = "pst" and the pattern is $(s xxx) then xxx is searched in the second options in opt. If ts is not specified, then it is set to "0123456789". In addition a format string fff and a unit uuu can be specified that is separated from the search string xxx by a single white space: $(fffuuu xxxx) $(offfuuu xxx). The format string starts with '' followed by the width, the precision and the conversion specifier, like for the printf function in C. For example: $(%.3fkHz frequency) A default string is specified with ':' directly following the format and unit. For example: $(%.3fkHz:10 frequency) would use '10' as the default string if 'frequency' is not found in opt. If no default string is explicitly specified in the search pattern dflt is used.

See also:
Str::translate()


Generated on Tue Mar 22 23:14:51 2011 for Relacs DataFile Library by  doxygen 1.5.3