CDBFAPI C++, .NET functions

Constructors:

        cdbfapiPlus();
        cdbfapiNet();

//////////////////////////////////////
        
void   initLibrary(int magicNumber, char* email);
void   initLibrary(int magicNumber, String^ email);

        allows you to use the library in a read/write mode.

//////////////////////////////////////

BOOL   openDBFfile(char* filename);
BOOL   openDBFfile(String^ filename);

        opens a file. returns non-zero value if successful and 0 if fail

void   closeDBFfile();

        closes the file and releases a used memory

//////////////////////////////////////

int    recCount();

        returns number of records in the file

int    fieldCount();

        returns number of fields in the file

//////////////////////////////////////

BOOL   readRecord(int recno);

        reads a record to internal memory block. 
        after reading you can use functions getString(), getValue()

BOOL   writeRecord(int recno);

        writes a record from internal memory block to the file.
        you have to fill the memory with necessary values using setValue()

//////////////////////////////////////

int   indexOfField(char* fieldname);
int   indexOfField(String^ fieldname);

        returns index of the field with the name in range 0 - fieldCount()-1
        returns -1 if the field does not exist.

//////////////////////////////////////

char*    getString(int fieldno);
String^  getString(int fieldno);

        returns content of any field as a string value

double getValue(int fieldno);

        returns content of numeric fields as a double value

//////////////////////////////////////

BOOL   isMemoField(int fieldno);

        returns TRUE for memo fields

BOOL   isNumericField(int fieldno);

        returns TRUE for numeric fields (N,F,Y,B)

//////////////////////////////////////

BOOL   isDeleted();

        returns TRUE if the record in the internal memory is marked as deleted

BOOL   isDeleted(int fieldno);

        returns TRUE if the specified record in the file is marked as deleted

//////////////////////////////////////

void   clearRecord();

        removes all information in the internal memory block and 
		fill fields with default values (0x00 or 0x20). 
		you have to call this when you want to add a new record

void   clearField(int fieldno);

        removes information in the specified field in the internal memory.

void   setField(int fieldno, char* string);
void   setField(int fieldno, String^ string);

        put the string value to the field

void   setField(int fieldno, double value);

        put the numeric value to the field

void   setField(int fieldno, char* string, double value);
void   setField(int fieldno, String^ string, double value);

        put either the string value or the numeric value to the field, 
		depending on field type

//////////////////////////////////////

BOOL   markAsDeleted(int fieldno);

        marks the record as deleted (marked with *)

BOOL   recallDeleted(int fieldno);

        removes the mark for the specified record.

//////////////////////////////////////

BOOL   deleteRecord(int recno);

        physically removes the record

BOOL   appendRecord(BOOL blankrecord);

        appends a new record to the file. 
		if blankrecord == TRUE, then record will be empty.
        if blankrecord == FALSE, then the information 
		from the internal memory block is used

BOOL   insertRecord(int recno, BOOL blankrecord);

        insert a new record to the file in position 'recno'

//////////////////////////////////////

void   setOrder(char* fieldlist);
void   setOrder(String^ fieldlist);

        sets order of records by some field or list of fields: FIELD1,FIELD2 

void   setOrderA(char* fields[]);

        sets order of records by some array of fields: { FIELD1,FIELD2,NULL }

void   unsetOrder();

        sets the default order.

void   setFilter(char* expression);
void   setFilter(String^ expression);

        set a filter for records by some criterion.
        you can use <, >, =, ==, <=, >=, ~ operators in the expression
        FIELD1=value
        FIELD2~substring        field contains a substring
        you can use & and | to unite expressions 
        FIELD1=123.45&FIELD2=John
        
void   unsetFilter();

        removes filter and order.

//////////////////////////////////////

BOOL   pack();

        removes records marked as deleted from the file

BOOL   zap();

        removes all records from the file

//////////////////////////////////////

int    fileType();

        returns a type of the file

int    recordLength();

        returns length of records

//////////////////////////////////////

char*     fieldName(int fieldno);
String^   fieldName(int fieldno);

        returns a name of the field

char   fieldType(int fieldno);

        returns a type of the field

int   fieldLength(int fieldno);

        returns length of the field

int   fieldDecimal(int fieldno);

        returns size of the fractional part for the numeric field

//////////////////////////////////////

BOOL   prepareNewTable();

        you have to call this when you want to create a new dbf file

void   addField(char* fieldname, char fieldType, int length);
void   addField(String^ fieldname, char fieldType, int length);

        adds a field to the new file

void   addField(char* fieldname, char fieldType, int length, int decimal);
void   addField(String^ fieldname, char fieldType, int length, int decimal);

        adds a field to the new file

BOOL   createTable(char* filename, int fileType);
BOOL   createTable(String^ filename, int fileType);

        creates a new file using previously added fields.
        returns non-zero if successful

BOOL   createAndOpenTable(char* filename, int fileType);
BOOL   createAndOpenTable(String^ filename, int fileType);

        creates a new file using previously added fields and opens it.
        returns non-zero if successful

//////////////////////////////////////

void   encoding(int encoding);

        sets the current encoding. 
        for DOS/Windows only 0 or 1 are valid.
        for iOS, OSX you can use any single-byte encoding

void   dateFormat(char* format);
void   dateFormat(String^ format);

        you can specify: dmy, mdy, ymd, asis

void   dateDelimiter(char delimiter);

        you can specify a symbol: - . /