SDTS_AL
|
#include <iso8211.h>
Public Member Functions | |
void | Dump (FILE *fp) |
const char * | GetSubfieldData (DDFSubfieldDefn *, int *=NULL, int=0) |
const char * | GetInstanceData (int nInstance, int *pnSize) |
const char * | GetData () |
int | GetDataSize () |
int | GetRepeatCount () |
DDFFieldDefn * | GetFieldDefn () |
This object represents one field in a DDFRecord. This models an instance of the fields data, rather than its 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().
void DDFField::Dump | ( | FILE * | fp | ) |
Write out field contents to debugging file.
A variety of information about this field, and all its subfields is written to the given debugging file handle. Note that field definition information (ala DDFFieldDefn) isn't written.
fp | The standard IO file handle to write to. i.e. stderr |
|
inline |
Return the pointer to the entire data block for this record. This is an internal copy, and should not be freed by the application.
|
inline |
Return the number of bytes in the data block returned by GetData().
|
inline |
Fetch the corresponding DDFFieldDefn.
const char * DDFField::GetInstanceData | ( | int | nInstance, |
int * | pnInstanceSize | ||
) |
Get field instance data and size.
The returned data pointer and size values are suitable for use with DDFRecord::SetFieldRaw().
nInstance | a value from 0 to GetRepeatCount()-1. |
pnInstanceSize | a location to put the size (in bytes) of the field instance data returned. This size will include the unit terminator (if any), but not the field terminator. This size pointer may be NULL if not needed. |
int DDFField::GetRepeatCount | ( | ) |
How many times do the subfields of this record repeat? This will always be one for non-repeating fields.
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.
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. |