43#ifndef GUM_CSV_PARSER_H
44#define GUM_CSV_PARSER_H
93 const std::string& filename,
94 const std::string& delimiter =
",",
95 const char commentmarker =
'#',
96 const char quoteMarker =
'"');
117 const std::vector< std::string >&
current()
const;
124 const std::string& delimiter =
",",
125 const char commentmarker =
'#',
126 const char quoteMarker =
'"');
131#ifndef DOXYGEN_SHOULD_SKIP_THIS
134 void _getNextTriplet_(
const std::string& str,
135 std::size_t& first_letter_token,
136 std::size_t& next_token,
137 std::size_t& last_letter_token,
138 std::size_t from)
const;
140 void _tokenize_(
const std::string& str);
142 std::size_t _correspondingQuoteMarker_(
const std::string& str, std::size_t pos)
const;
146 std::string _delimiter_;
147 std::string _spaces_;
148 std::string _delimiterPlusSpaces_;
149 std::size_t _nbLine_;
150 char _commentMarker_;
154 std::istream* _instream_;
155 std::vector< std::string > _data_;
156 const std::string _filename_;
CSVParser(std::istream &in, const std::string &filename, const std::string &delimiter=",", const char commentmarker='#', const char quoteMarker='"')
default constructor
void useNewStream(std::istream &in, const std::string &delimiter=",", const char commentmarker='#', const char quoteMarker='"')
reopens a new input stream to parse
bool next()
gets the next line of the csv stream and parses it
std::size_t nbLine() const
returns the current line number within the stream
virtual ~CSVParser()
destructor
const std::vector< std::string > & current() const
returns the current parsed line
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities