45 const std::string& defDelim,
46 const std::string& lineDelim,
47 bool prune,
bool ignoreCase)
58 const std::string& defDelim,
59 const std::string& lineDelim,
60 bool prune,
bool ignoreCase) {
84 int pos = (*i).second;
105 int pos = (*i).second;
118 const std::string& delim,
127 std::string next = st.
next();
129 myDefinitionsMap.insert(std::map<std::string, int>::value_type(next, pos++));
139 std::string::size_type idx = str.find_first_not_of(
" ");
140 if (idx != std::string::npos) {
141 str = str.substr(idx);
143 idx = str.find_last_not_of(
" ");
144 if (idx != std::string::npos && idx != str.length() - 1) {
145 str = str.substr(0, idx + 1);
PosMap myDefinitionsMap
The map of column item names to their positions within the table.
std::string get(int pos) const
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
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.
NamedColumnsParser()
Constructor.
~NamedColumnsParser()
Destructor.
static std::string to_lower_case(std::string str)
Transfers the content to lower case.
StringTokenizer myLineParser
The contents of the current 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.
void checkPrune(std::string &str, bool prune) const
Prunes the given string if it shall be done.
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.