gSAFE
1.3.8
|
#include <xbio.h>
Public Member Functions | |
HXBaseFileWriter (HCodepageConvert *conv, bool deletecobj=false) | |
~HXBaseFileWriter (void) | |
int | appendRecord (void) |
int | close (void) |
int | create (QString name, int version) |
void | defineField (QString name, HXBaseFieldType type, int length=0, int nofdecimals=0) |
int | open (QString name) |
int | resetRecord (void) |
int | setFieldBool (QString fname, bool logical) |
int | setFieldDate (QString fname, QDate date) |
int | setFieldDecimal (QString fname, long decimal) |
int | setFieldFloat (QString fname, double val) |
int | setFieldStr (QString fname, QString str) |
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) |
Protected Member Functions | |
void | setLastDefinedField (int idx) |
Protected Attributes | |
int | defined_fnum |
xbSchema * | schema |
Protected Attributes inherited from HXBaseFileHandler | |
char * | buffer |
HCodepageConvert * | c |
xbDbf * | dbf |
bool | deleteconvertobject |
bool | opened |
xbXBase * | xbase |
Additional Inherited Members | |
Signals inherited from HXBaseFileHandler | |
void | errorSignal (QString error) |
You can create and write one XBase files with this class. - Define the scheme - Create the file - Write the records - Close the file
HXBaseFileWriter::HXBaseFileWriter | ( | HCodepageConvert * | conv, |
bool | deletecobj = false |
||
) |
Creates a XBase file writer object
conv | The codepage converter of the class (put a HCodepageConvert descendant object according to the coding of the dbf file) |
deletecobj | if this parameter true the "conv" object is deleted if not used. |
int HXBaseFileWriter::appendRecord | ( | void | ) |
int HXBaseFileWriter::close | ( | void | ) |
int HXBaseFileWriter::create | ( | QString | name, |
int | version | ||
) |
Creates the XBase file. You have to specify the schema before with the defineField() function. After calling this function the dbf is opened. (Do not call the open()!)
name | the path and name of the file |
version | the version of the file (eg: 3 or 4) |
void HXBaseFileWriter::defineField | ( | QString | name, |
HXBaseFieldType | type, | ||
int | length = 0 , |
||
int | nofdecimals = 0 |
||
) |
Define a field in the schema of XBase file. You can only use this function before create() ! The field specified with this function will be appended to the existing field list.
name | the name of the field (limited to 10 char. XBase limit) |
type | the type of the field. See HXBaseFieldType enum |
length | the length of the field. |
nofdecimals | the number of decimals |
int HXBaseFileWriter::open | ( | QString | name | ) |
int HXBaseFileWriter::resetRecord | ( | void | ) |
int HXBaseFileWriter::setFieldBool | ( | QString | fname, |
bool | logical | ||
) |
int HXBaseFileWriter::setFieldDate | ( | QString | fname, |
QDate | date | ||
) |
int HXBaseFileWriter::setFieldDecimal | ( | QString | fname, |
long | decimal | ||
) |
int HXBaseFileWriter::setFieldFloat | ( | QString | fname, |
double | val | ||
) |
int HXBaseFileWriter::setFieldStr | ( | QString | fname, |
QString | str | ||
) |