gSAFE  1.3.8
Public Member Functions | List of all members
HXBaseFileReader Class Reference

#include <xbio.h>

Inheritance diagram for HXBaseFileReader:
HXBaseFileHandler

Public Member Functions

 HXBaseFileReader (HCodepageConvert *conv, bool deletecobj=false)
 
 ~HXBaseFileReader (void)
 
int close (void)
 
int firstRecord (void)
 
bool getCellBool (long rec, QString fname)
 
QDate getCellDate (long rec, QString fname)
 
long getCellDecimal (long rec, QString fname)
 
double getCellFloat (long rec, QString fname)
 
QString getCellStr (long rec, QString fname)
 
long getCurrentRecordIdx (void)
 
bool getFieldBool (QString fname)
 
QDate getFieldDate (QString fname)
 
long getFieldDecimal (QString fname)
 
double getFieldFloat (QString fname)
 
QString getFieldStr (QString fname)
 
int lastRecord (void)
 
int nextRecord (void)
 
int open (QString name)
 
int prevRecord (void)
 
int toRecord (long idx)
 
- Public Member Functions inherited from HXBaseFileHandler
 HXBaseFileHandler (HCodepageConvert *conv, bool deletecobj=false)
 
 ~HXBaseFileHandler (void)
 
int fieldCount (void)
 
QString fieldName (int n)
 
HXBaseFieldType fieldType (int n)
 
long recordCount (void)
 

Additional Inherited Members

- Signals inherited from HXBaseFileHandler
void errorSignal (QString error)
 
- Protected Attributes inherited from HXBaseFileHandler
char * buffer
 
HCodepageConvertc
 
xbDbf * dbf
 
bool deleteconvertobject
 
bool opened
 
xbXBase * xbase
 

Detailed Description

You can read one XBase files with this class.

HXBaseFileReader reader(new HCodepage852(),true);
connect(&reader,SIGNAL(errorSignal(QString)),this,SLOT(slotError(QString)));
reader.open("DATA.DBF");
r = reader.firstRecord();
while(r == 0)
{
toDo( reader.getFieldStr("STREET") );
r = reader.nextRecord();
}
reader.close();
See Also
HXBaseFileWriter

Definition at line 134 of file xbio.h.

Constructor & Destructor Documentation

HXBaseFileReader::HXBaseFileReader ( HCodepageConvert conv,
bool  deletecobj = false 
)

Creates a XBase file reader object

Parameters
convThe codepage converter of the class (put a HCodepageConvert descendant object according to the coding of the dbf file)
deletecobjif this parameter true the "conv" object is deleted if not used.

Definition at line 171 of file xbio.cpp.

HXBaseFileReader::~HXBaseFileReader ( void  )

Destructor

Definition at line 176 of file xbio.cpp.

Member Function Documentation

int HXBaseFileReader::close ( void  )

Close the currently opened file

Definition at line 201 of file xbio.cpp.

int HXBaseFileReader::firstRecord ( void  )

Jump to the first record, and makes it current

int r = reader.firstRecord();
while(r == 0)
{
toDo( reader.getFieldStr("FIELD1") );
r = reader.nextRecord();
}
Returns
0 if success
See Also
nextRecord()

Definition at line 227 of file xbio.cpp.

long HXBaseFileReader::getCurrentRecordIdx ( void  )

Returns the index of the current record

Definition at line 275 of file xbio.cpp.

bool HXBaseFileReader::getFieldBool ( QString  fname)

Get a value of a named field from the current record

Definition at line 311 of file xbio.cpp.

QDate HXBaseFileReader::getFieldDate ( QString  fname)

Get a value of a named field from the current record

Definition at line 321 of file xbio.cpp.

long HXBaseFileReader::getFieldDecimal ( QString  fname)

Get a value of a named field from the current record

Definition at line 291 of file xbio.cpp.

double HXBaseFileReader::getFieldFloat ( QString  fname)

Get a value of a named field from the current record

Definition at line 301 of file xbio.cpp.

QString HXBaseFileReader::getFieldStr ( QString  fname)

Get a value of a named field from the current record

Definition at line 280 of file xbio.cpp.

int HXBaseFileReader::lastRecord ( void  )

Jump to the last record, and makes it current

Returns
0 if success
See Also
firstRecord()

Definition at line 239 of file xbio.cpp.

int HXBaseFileReader::nextRecord ( void  )

Jump to the next record, and makes it current

Returns
0 if success (if we reach the end got 1)
See Also
firstRecord()

Definition at line 251 of file xbio.cpp.

int HXBaseFileReader::open ( QString  name)

Opens a XBase file.

Parameters
namethe path and name of the file
Returns
0 if success

Definition at line 182 of file xbio.cpp.

int HXBaseFileReader::prevRecord ( void  )

Jump to the next record, and makes it current

Returns
0 if success (if we reach the end got 1)
See Also
nextRecord()

Definition at line 263 of file xbio.cpp.

int HXBaseFileReader::toRecord ( long  idx)

Jump to the specified record, and makes it current

Parameters
idxthe index of the necessary record
Returns
0 if success

Definition at line 213 of file xbio.cpp.


The documentation for this class was generated from the following files: