Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

DDFRecord Class Reference

Contains instance data from one data record (DR). More...

#include <iso8211.h>

List of all members.


Public Members

DDFRecord* Clone ()
Make a copy of a record. More...

void Dump ( FILE * )
Write out record contents to debugging file. More...

int GetFieldCount ()
Get the number of DDFFields on this record.

DDFFieldFindField ( const char *, int = 0 )
Find the named field within this record. More...

DDFFieldGetField ( int )
Fetch field object based on index. More...

int GetIntSubfield ( const char *, int, const char *, int, int * = NULL )
Fetch value of a subfield as an integer. More...

double GetFloatSubfield ( const char *, int, const char *, int, int * = NULL )
Fetch value of a subfield as a float (double). More...

const char* GetStringSubfield ( const char *, int, const char *, int, int * = NULL )
Fetch value of a subfield as a string. More...

int GetDataSize ()
Fetch size of records raw data (GetData()) in bytes.

const char* GetData ()
Fetch the raw data for this record. More...

DDFModuleGetModule ()
Fetch the DDFModule with which this record is associated.


Detailed Description

Contains instance data from one data record (DR).

The data is contained as a list of DDFField instances partitioning the raw data into fields.


Member Function Documentation

DDFRecord * DDFRecord::Clone ()

Make a copy of a record.

This method is used to make a copy of a record that will become (mostly) the properly of application. However, it is automatically destroyed if the DDFModule it was created relative to is destroyed, as it's field and subfield definitions relate to that DDFModule. However, it does persist even when the record returned by DDFModule::ReadRecord() is invalidated, such as when reading a new record. This allows an application to cache whole DDFRecords.

Returns:
A new copy of the DDFRecord. This can be delete'd by the application when no longer needed, otherwise it will be cleaned up when the DDFModule it relates to is destroyed or closed.

void DDFRecord::Dump (FILE * fp)

Write out record contents to debugging file.

A variety of information about this record, and all it's fields and subfields is written to the given debugging file handle. Note that field definition information (ala DDFFieldDefn) isn't written.

Parameters:
fp - The standard io file handle to write to. ie. stderr

DDFField * DDFRecord::FindField (const char * pszName, int iFieldIndex = 0)

Find the named field within this record.

Parameters:
pszName - The name of the field to fetch. The comparison is case insensitive.
iFieldIndex - The instance of this field to fetch. Use zero (the default) for the first instance.

Returns:
Pointer to the requested DDFField. This pointer is to an internal object, and should not be freed. It remains valid until the next record read.

DDFField * DDFRecord::GetField (int i)

Fetch field object based on index.

Parameters:
i - The index of the field to fetch. Between 0 and GetFieldCount()-1.

Returns:
A DDFField pointer, or NULL if the index is out of range.

int DDFRecord::GetIntSubfield (const char * pszField, int iFieldIndex, const char * pszSubfield, int iSubfieldIndex, int * pnSuccess = NULL)

Fetch value of a subfield as an integer.

This is a convenience function for fetching a subfield of a field within this record.

Parameters:
pszField - The name of the field containing the subfield.
iFieldIndex - The instance of this field within the record. Use zero for the first instance of this field.
pszSubfield - The name of the subfield within the selected field.
iSubfieldIndex - The instance of this subfield within the record. Use zero for the first instance.
pnSuccess - Pointer to an int which will be set to TRUE if the fetch succeeds, or FALSE if it fails. Use NULL if you don't want to check success.
Returns:
The value of the subfield, or zero if it failed for some reason.

double DDFRecord::GetFloatSubfield (const char * pszField, int iFieldIndex, const char * pszSubfield, int iSubfieldIndex, int * pnSuccess = NULL)

Fetch value of a subfield as a float (double).

This is a convenience function for fetching a subfield of a field within this record.

Parameters:
pszField - The name of the field containing the subfield.
iFieldIndex - The instance of this field within the record. Use zero for the first instance of this field.
pszSubfield - The name of the subfield within the selected field.
iSubfieldIndex - The instance of this subfield within the record. Use zero for the first instance.
pnSuccess - Pointer to an int which will be set to TRUE if the fetch succeeds, or FALSE if it fails. Use NULL if you don't want to check success.
Returns:
The value of the subfield, or zero if it failed for some reason.

const char * DDFRecord::GetStringSubfield (const char * pszField, int iFieldIndex, const char * pszSubfield, int iSubfieldIndex, int * pnSuccess = NULL)

Fetch value of a subfield as a string.

This is a convenience function for fetching a subfield of a field within this record.

Parameters:
pszField - The name of the field containing the subfield.
iFieldIndex - The instance of this field within the record. Use zero for the first instance of this field.
pszSubfield - The name of the subfield within the selected field.
iSubfieldIndex - The instance of this subfield within the record. Use zero for the first instance.
pnSuccess - Pointer to an int which will be set to TRUE if the fetch succeeds, or FALSE if it fails. Use NULL if you don't want to check success.
Returns:
The value of the subfield, or NULL if it failed for some reason. The returned pointer is to internal data and should not be modified or freed by the application.

const char * DDFRecord::GetData ()

Fetch the raw data for this record.

The returned pointer is effectively to the data for the first field of the record, and is of size GetDataSize().


The documentation for this classwas generated from the following files:
Generated at Wed Sep 22 10:32:06 1999 for SDTS_AL by doxygen  written by Dimitri van Heesch, © 1997-1999