DDFModule Class Reference

#include <iso8211.h>

List of all members.

Public Member Functions

 DDFModule ()
 ~DDFModule ()
int Open (const char *pszFilename, int bFailQuietly=FALSE)
void Close ()
void Dump (FILE *fp)
DDFRecordReadRecord (void)
void Rewind (long nOffset=-1)
DDFFieldDefnFindFieldDefn (const char *)
int GetFieldCount ()
DDFFieldDefnGetField (int)
void AddField (DDFFieldDefn *poNewFDefn)

Detailed Description

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.


Constructor & Destructor Documentation

DDFModule::DDFModule (  ) 

The constructor.

DDFModule::~DDFModule (  ) 

The destructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
pszFieldName The name of the field to search for. The comparison is case insensitive.
Returns:
A pointer to the request DDFFieldDefn object is returned, or NULL if none matching the name are found. The return object remains owned by the DDFModule, and should not be deleted by application code.
DDFFieldDefn * DDFModule::GetField ( int  i  ) 

Fetch a field definition by index.

Parameters:
i (from 0 to GetFieldCount() - 1.
Returns:
the returned field pointer or NULL if the index is out of range.
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.

Parameters:
pszFilename The name of the file to open.
bFailQuietly If FALSE a CPL Error is issued for non-8211 files, otherwise quietly return NULL.
Returns:
FALSE if the open fails or TRUE if it succeeds. Errors messages are issued internally with CPLError().
DDFRecord * DDFModule::ReadRecord ( void   ) 

Read one record from the file.

Returns:
A pointer to a DDFRecord object is returned, or NULL if a read error, or end of file occurs. The returned record is owned by the module, and should not be deleted by the application. The record is only valid untill the next ReadRecord() at which point it is overwritten.
void DDFModule::Rewind ( long  nOffset = -1  ) 

Return to first record.

The next call to ReadRecord() will read the first data record in the file.

Parameters:
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.

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

Generated on 2 Aug 2014 for ISO8211Lib by  doxygen 1.6.1