21 #ifndef NamedColumnsParser_h
22 #define NamedColumnsParser_h
80 const std::string& lineDelim =
";",
bool chomp =
false,
81 bool ignoreCase =
true);
99 void reinit(
const std::string& def,
const std::string& defDelim =
";",
100 const std::string& lineDelim =
";",
bool chomp =
false,
101 bool ignoreCase =
true);
129 std::string
get(
const std::string& name,
130 bool prune =
false)
const;
138 bool know(
const std::string& name)
const;
161 void reinitMap(std::string def,
const std::string& delim =
";",
173 void checkPrune(std::string& str,
bool prune)
const;
178 typedef std::map<std::string, size_t>
PosMap;
PosMap myDefinitionsMap
The map of column item names to their positions within the table.
void reinit(const std::string &def, const std::string &defDelim=";", const std::string &lineDelim=";", bool chomp=false, bool ignoreCase=true)
Reinitialises the parser.
NamedColumnsParser()
Constructor.
std::map< std::string, size_t > PosMap
The map's definition of column item names to their positions within the table.
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
void checkPrune(std::string &str, bool prune) const
Prunes the given string if it shall be done.
bool know(const std::string &name) const
Returns the information whether the named column is known.
~NamedColumnsParser()
Destructor.
StringTokenizer myLineParser
The contents of the current line.
A parser to retrieve information from a table with known columns.
void reinitMap(std::string def, const std::string &delim=";", bool chomp=false)
Rebuilds the map of attribute names to their positions in a table.
bool myAmCaseInsensitive
Information whether case insensitive match shall be done.
void parseLine(const std::string &line)
Parses the contents of the line.
std::string myLineDelimiter
The delimiter to split the column items on.