[Positioner] Add CSVStringReader(string)
Add a string constructor for CSVStringReader, for easier use outside of CSVFileReader.
This commit is contained in:
parent
2e323be423
commit
9ef599b42f
|
@ -52,6 +52,13 @@ using namespace boost ;
|
||||||
/* *** Constructors *** */
|
/* *** Constructors *** */
|
||||||
|
|
||||||
|
|
||||||
|
CSVStringReader::
|
||||||
|
CSVStringReader(const std::string &_str, const char _separator):
|
||||||
|
separator(_separator), current_token(NULL), current_field_nb(0)
|
||||||
|
{
|
||||||
|
set_str(_str) ;
|
||||||
|
}
|
||||||
|
|
||||||
CSVStringReader::~CSVStringReader()
|
CSVStringReader::~CSVStringReader()
|
||||||
{
|
{
|
||||||
delete current_token ;
|
delete current_token ;
|
||||||
|
@ -63,10 +70,7 @@ CSVStringReader::~CSVStringReader()
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note that this function is not called by the constructor, so you
|
* @returns \em false in case of error (EOF, etc.), \em true else.
|
||||||
* must manually call it to set a string to process prior to use
|
|
||||||
* read_field().
|
|
||||||
* @return \em false in case of error (EOF, etc.), \em true else.
|
|
||||||
*/
|
*/
|
||||||
void CSVStringReader::set_str(const string &_str)
|
void CSVStringReader::set_str(const string &_str)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
CSVStringReader(const char _separator = ';'):
|
CSVStringReader(const char _separator = ';'):
|
||||||
separator(_separator), current_token(NULL), current_field_nb(0) {}
|
separator(_separator), current_token(NULL), current_field_nb(0) {}
|
||||||
|
|
||||||
|
CSVStringReader(const std::string &_str, const char _separator = ';') ;
|
||||||
|
|
||||||
virtual ~CSVStringReader(void) ;
|
virtual ~CSVStringReader(void) ;
|
||||||
|
|
||||||
/** @name Accessors */
|
/** @name Accessors */
|
||||||
|
|
Loading…
Reference in New Issue