35 #include "CSV_Reader.h"
36 #include "CSV_Utils.h"
46 CSV_Reader::CSV_Reader()
48 _stream_in =
new fstream() ;
51 CSV_Reader::~CSV_Reader()
55 if( _stream_in->is_open() )
65 CSV_Reader::open(
const string& filepath )
68 _filepath = filepath ;
69 _stream_in->open( filepath.c_str(), fstream::in ) ;
70 if( !(_stream_in->fail()) && _stream_in->is_open() )
78 CSV_Reader::close()
const
84 if( !(_stream_in->bad()) && !(_stream_in->is_open()) )
93 CSV_Reader::eof()
const
95 return _stream_in->eof() ;
101 _stream_in->seekg( ios::beg ) ;
106 CSV_Reader::get( vector<string> &row )
110 getline( *_stream_in, line ) ;
117 strm << BESIndent::LMarg <<
"CSV_Reader::dump - ("
118 << (
void *)
this <<
")" << endl ;
119 BESIndent::Indent() ;
122 strm << BESIndent::LMarg <<
"File " << _filepath <<
" is open" << endl ;
126 strm << BESIndent::LMarg <<
"No stream opened at this time" << endl ;
128 BESIndent::UnIndent() ;