Minsky
SpaceSeparatorParser Struct Reference
Collaboration diagram for SpaceSeparatorParser:
Collaboration graph

Public Member Functions

 SpaceSeparatorParser (char escape='\\', char sep=' ', char quote='"')
 
template<class I >
bool operator() (I &next, I end, std::string &tok)
 
void reset ()
 

Public Attributes

char escape
 
char quote
 

Detailed Description

Definition at line 159 of file CSVParser.cc.

Constructor & Destructor Documentation

◆ SpaceSeparatorParser()

SpaceSeparatorParser::SpaceSeparatorParser ( char  escape = '\\',
char  sep = ' ',
char  quote = '"' 
)
inline

Definition at line 162 of file CSVParser.cc.

Member Function Documentation

◆ operator()()

template<class I >
bool SpaceSeparatorParser::operator() ( I &  next,
end,
std::string &  tok 
)
inline

Definition at line 165 of file CSVParser.cc.

166  {
167  tok.clear();
168  bool quoted=false;
169  while (next!=end)
170  {
171  if (*next==escape)
172  tok+=*(++next);
173  else if (*next==quote)
174  quoted=!quoted;
175  else if (!quoted && isspace(*next))
176  {
177  while (isspace(*next)) ++next;
178  return true;
179  }
180  else
181  tok+=*next;
182  ++next;
183  }
184  return !tok.empty();
185  }

◆ reset()

void SpaceSeparatorParser::reset ( )
inline

Definition at line 186 of file CSVParser.cc.

186 {}

Member Data Documentation

◆ escape

char SpaceSeparatorParser::escape

Definition at line 161 of file CSVParser.cc.

◆ quote

char SpaceSeparatorParser::quote

Definition at line 161 of file CSVParser.cc.


The documentation for this struct was generated from the following file: