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

DDFField Class Reference

This object represents one field in a DDFRecord. More...

#include <iso8211.h>

List of all members.


Public Members

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

const char* GetSubfieldData ( DDFSubfieldDefn *, int * = NULL, int = 0 )
Fetch raw data pointer for a particular subfield of this field. More...

const char* GetData ()
Return the pointer to the entire data block for this record. More...

int GetDataSize ()
Return the number of bytes in the data block returned by GetData().

int GetRepeatCount ()
How many times do the subfields of this record repeat? This will always be one for non-repeating fields. More...

DDFFieldDefnGetFieldDefn ()
Fetch the corresponding DDFFieldDefn.


Detailed Description

This object represents one field in a DDFRecord.

This models an instance of the fields data, rather than it's data definition which is handled by the DDFFieldDefn class. Note that a DDFField doesn't have DDFSubfield children as you would expect. To extract subfield values use GetSubfieldData() to find the right data pointer and then use ExtractIntData(), ExtractFloatData() or ExtractStringData().


Member Function Documentation

void DDFField::Dump (FILE * fp)

Write out field contents to debugging file.

A variety of information about this field, and all it's 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

const char * DDFField::GetSubfieldData (DDFSubfieldDefn * poSFDefn, int * pnMaxBytes = NULL, int iSubfieldIndex = 0)

Fetch raw data pointer for a particular subfield of this field.

The passed DDFSubfieldDefn (poSFDefn) should be acquired from the DDFFieldDefn corresponding with this field. This is normally done once before reading any records. This method involves a series of calls to DDFSubfield::GetDataLength() in order to track through the DDFField data to that belonging to the requested subfield. This can be relatively expensive.

Parameters:
poSFDefn - The definition of the subfield for which the raw data pointer is desired.
pnMaxBytes - The maximum number of bytes that can be accessed from the returned data pointer is placed in this int, unless it is NULL.
iSubfieldIndex - The instance of this subfield to fetch. Use zero (the default) for the first instance.

Returns:
A pointer into the DDFField's data that belongs to the subfield. This returned pointer is invalidated by the next record read (DDFRecord::ReadRecord()) and the returned pointer should not be freed by the application.

const char * DDFField::GetData ()

Return the pointer to the entire data block for this record.

This is an internal copy, and shouldn't be freed by the application.

int DDFField::GetRepeatCount ()

How many times do the subfields of this record repeat? This will always be one for non-repeating fields.

Returns:
The number of times that the subfields of this record occur in this record. This will be one for non-repeating fields.

See also:
8211view example program for demonstation of handling repeated fields properly.

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