 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef NamedColumnsParser_h
19 #define NamedColumnsParser_h
73 const std::string& lineDelim =
";",
bool chomp =
false,
74 bool ignoreCase =
true);
92 void reinit(
const std::string& def,
const std::string& defDelim =
";",
93 const std::string& lineDelim =
";",
bool chomp =
false,
94 bool ignoreCase =
true);
122 std::string
get(
const std::string& name,
123 bool prune =
false)
const;
131 bool know(
const std::string& name)
const;
154 void reinitMap(std::string def,
const std::string& delim =
";",
166 void checkPrune(std::string& str,
bool prune)
const;
171 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.