Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

fbwrap::CSVInStream Class Reference

Class for handling csv stream reading. More...

#include <CsvDrv.h>

Inheritance diagram for fbwrap::CSVInStream:

fbwrap::CSVInFile List of all members.

Public Types

enum  errorCodes { e_no_error, e_cant_open, e_not_opened }

Public Methods

 CSVInStream (std::istream &p_is, char psep, char lFlag)
 Constructor.

virtual void First ()
 Reads the first record.

virtual void Next ()
 Reads next record.

bool Eof ()
 returns true if end of stream has been reached

int FieldCount ()
 Number of fields.


Public Attributes

FieldList Fields
 fields for the current record


Protected Methods

bool ReadField (string &s)
void ReadRecord ()
 Reads next record.

bool CheckLineEnd (char c)
 function for checking line termination

void ClearRecord ()
 Clear all field values.

string FieldName (int n)
 returns name of nth field

void setError (int n)

Protected Attributes

int nRecs

Detailed Description

Class for handling csv stream reading.

CSV files are very common for interchange data between diferent database formats. The class handles diferent line end combinations for records:


Constructor & Destructor Documentation

fbwrap::CSVInStream::CSVInStream std::istream &    p_is,
char    psep,
char    lFlag
 

Constructor.

Parameters:
p_is  input stream reference
psep  character used to separate fields in record
lFlag  for marking literal values,
ex. "only,one,field" is treated as one value if lFlag='"',
otherwise we have 3 values '"only' 'one' and 'field"'.


Member Function Documentation

int fbwrap::CSVInStream::FieldCount   [inline]
 

Number of fields.

Number of fields in the current record, may be diferent on the same input stream.

bool fbwrap::CSVInStream::ReadField string &    s [protected]
 

Reads next field in the current record, returns false if eol is found, true otherwise.

Parameters:
s  string reference holding value read


The documentation for this class was generated from the following files:
Generated on Fri Jan 31 08:30:04 2003 for fbwrap by doxygen1.2.17