#include <iso8211.h>
Public Member Functions | |
DDFModule () | |
~DDFModule () | |
int | Open (const char *pszFilename, int bFailQuietly=FALSE) |
void | Close () |
void | Dump (FILE *fp) |
DDFRecord * | ReadRecord (void) |
void | Rewind (long nOffset=-1) |
DDFFieldDefn * | FindFieldDefn (const char *) |
int | GetFieldCount () |
DDFFieldDefn * | GetField (int) |
void | AddField (DDFFieldDefn *poNewFDefn) |
The primary class for reading ISO 8211 files. This class contains all the information read from the DDR record, and is used to read records from the file.
DDFModule::DDFModule | ( | ) |
The constructor.
DDFModule::~DDFModule | ( | ) |
The destructor.
void DDFModule::AddField | ( | DDFFieldDefn * | poNewFDefn | ) |
Add new field definition.
Field definitions may only be added to DDFModules being used for writing, not those being used for reading. Ownership of the DDFFieldDefn object is taken by the DDFModule.
poNewFDefn | definition to be added to the module. |
void DDFModule::Close | ( | ) |
Close an ISO 8211 file.
void DDFModule::Dump | ( | FILE * | fp | ) |
Write out module info to debugging file.
A variety of information about the module is written to the debugging file. This includes all the field and subfield definitions read from the header.
fp | The standard io file handle to write to. ie. stderr. |
DDFFieldDefn * DDFModule::FindFieldDefn | ( | const char * | pszFieldName | ) |
Fetch the definition of the named field.
This function will scan the DDFFieldDefn's on this module, to find one with the indicated field name.
pszFieldName | The name of the field to search for. The comparison is case insensitive. |
DDFFieldDefn * DDFModule::GetField | ( | int | i | ) |
Fetch a field definition by index.
i | (from 0 to GetFieldCount() - 1. |
int DDFModule::GetFieldCount | ( | ) | [inline] |
Fetch the number of defined fields.
int DDFModule::Open | ( | const char * | pszFilename, | |
int | bFailQuietly = FALSE | |||
) |
Open a ISO 8211 (DDF) file for reading.
If the open succeeds the data descriptive record (DDR) will have been read, and all the field and subfield definitions will be available.
pszFilename | The name of the file to open. | |
bFailQuietly | If FALSE a CPL Error is issued for non-8211 files, otherwise quietly return NULL. |
DDFRecord * DDFModule::ReadRecord | ( | void | ) |
Read one record from the file.
void DDFModule::Rewind | ( | long | nOffset = -1 |
) |
Return to first record.
The next call to ReadRecord() will read the first data record in the file.
nOffset | the offset in the file to return to. By default this is -1, a special value indicating that reading should return to the first data record. Otherwise it is an absolute byte offset in the file. |