NDEVR
API Documentation
DBFParser

Logic for reading or writing to a database file that uses the .dbf file extension. More...

Public Member Functions

 DBFParser (const File &file)
 Constructs a DBFParser by opening and parsing the header of the given .dbf file.
void DumpAll (const char *szDestFileName)
 Dumps all records from the .dbf file to a destination text file.
void DumpFields (const char *szDestFileName, const char **fields, size_t numFields)
 Dumps only the specified fields from the .dbf file to a destination text file.
template<class t_type>
Buffer< t_type > readColumn (const StringView &column)
 Reads all values from a named column and returns them converted to the requested type.
uint04 recordCount () const
 Returns the number of records in the .dbf file.

Detailed Description

Logic for reading or writing to a database file that uses the .dbf file extension.


Definition at line 15 of file DBFParser.h.

Constructor & Destructor Documentation

◆ DBFParser()

DBFParser::DBFParser ( const File & file)

Constructs a DBFParser by opening and parsing the header of the given .dbf file.

Parameters
[in]fileThe .dbf file to parse.

Member Function Documentation

◆ DumpAll()

void DBFParser::DumpAll ( const char * szDestFileName)

Dumps all records from the .dbf file to a destination text file.

Parameters
[in]szDestFileNameThe path to the destination file.

◆ DumpFields()

void DBFParser::DumpFields ( const char * szDestFileName,
const char ** fields,
size_t numFields )

Dumps only the specified fields from the .dbf file to a destination text file.

Parameters
[in]szDestFileNameThe path to the destination file.
[in]fieldsArray of field name strings to include.
[in]numFieldsThe number of field names in the fields array.

◆ readColumn()

template<class t_type>
Buffer< t_type > DBFParser::readColumn ( const StringView & column)
inline

Reads all values from a named column and returns them converted to the requested type.

Parameters
[in]columnThe name of the column to read.
Returns
A Buffer of values from the specified column, converted to t_type.

Definition at line 46 of file DBFParser.h.

References Buffer< t_type, t_memory_manager >::add(), String::getAs(), IsInvalid(), and String::trimWhiteSpace().

◆ recordCount()

uint04 DBFParser::recordCount ( ) const
inline

Returns the number of records in the .dbf file.

Returns
The total record count from the file header.

Definition at line 39 of file DBFParser.h.


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