 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
17 #ifndef NamedColumnsParser_h
18 #define NamedColumnsParser_h
72 const std::string& lineDelim =
";",
bool chomp =
false,
73 bool ignoreCase =
true);
91 void reinit(
const std::string& def,
const std::string& defDelim =
";",
92 const std::string& lineDelim =
";",
bool chomp =
false,
93 bool ignoreCase =
true);
121 std::string
get(
const std::string& name,
122 bool prune =
false)
const;
130 bool know(
const std::string& name)
const;
153 void reinitMap(std::string def,
const std::string& delim =
";",
165 void checkPrune(std::string& str,
bool prune)
const;
170 typedef std::map<std::string, int>
PosMap;
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
void parseLine(const std::string &line)
Parses the contents of the line.
std::string myLineDelimiter
The delimiter to split the column items on.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
void reinitMap(std::string def, const std::string &delim=";", bool chomp=false)
Rebuilds the map of attribute names to their positions in a table.
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.
bool myAmCaseInsensitive
Information whether case insensitive match shall be done.
NamedColumnsParser()
Constructor.
~NamedColumnsParser()
Destructor.
std::map< std::string, int > PosMap
The map's definition of column item names to their positions within the table.
PosMap myDefinitionsMap
The map of column item names to their positions within the table.
StringTokenizer myLineParser
The contents of the current line.
void checkPrune(std::string &str, bool prune) const
Prunes the given string if it shall be done.
A parser to retrieve information from a table with known columns.