70 const std::string& lineDelim =
";",
bool chomp =
false,
71 bool ignoreCase =
true);
89 void reinit(
const std::string& def,
const std::string& defDelim =
";",
90 const std::string& lineDelim =
";",
bool chomp =
false,
91 bool ignoreCase =
true);
119 std::string
get(
const std::string& name,
120 bool prune =
false)
const;
128 bool know(
const std::string& name)
const;
151 void reinitMap(std::string def,
const std::string& delim =
";",
163 void checkPrune(std::string& str,
bool prune)
const;
168 typedef std::map<std::string, int>
PosMap;
A parser to retrieve information from a table with known columns.
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
void reinit(const std::string &def, const std::string &defDelim=";", const std::string &lineDelim=";", bool chomp=false, bool ignoreCase=true)
Reinitialises the parser.
bool know(const std::string &name) const
Returns the information whether the named column is known.
std::map< std::string, int > PosMap
The map's definition of column item names to their positions within the table.
void parseLine(const std::string &line)
Parses the contents of the line.
void reinitMap(std::string def, const std::string &delim=";", bool chomp=false)
Rebuilds the map of attribute names to their positions in a table.
PosMap myDefinitionsMap
The map of column item names to their positions within the table.
std::string myLineDelimiter
The delimiter to split the column items on.
bool myAmCaseInsensitive
Information whether case insensitive match shall be done.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
NamedColumnsParser()
Constructor.
StringTokenizer myLineParser
The contents of the current line.
~NamedColumnsParser()
Destructor.
void checkPrune(std::string &str, bool prune) const
Prunes the given string if it shall be done.