OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
Information from the DDR record describing one subfield of a DDFFieldDefn. More...
#include <ossimIso8211.h>
Public Types | |
enum | DDFBinaryFormat { NotBinary =0, UInt =1, SInt =2, FPReal =3, FloatReal =4, FloatComplex =5 } |
Binary format: this is the digit immediately following the B or b for binary formats. More... | |
Public Member Functions | |
ossimDDFSubfieldDefn () | |
~ossimDDFSubfieldDefn () | |
void | SetName (const char *pszName) |
const char * | GetName () |
Get pointer to subfield name. More... | |
const char * | GetFormat () |
Get pointer to subfield format string. More... | |
int | SetFormat (const char *pszFormat) |
DDFDataType | GetType () |
Get the general type of the subfield. More... | |
double | ExtractFloatData (const char *pachData, int nMaxBytes, int *pnConsumedBytes) |
Extract a subfield value as a float. More... | |
int | ExtractIntData (const char *pachData, int nMaxBytes, int *pnConsumedBytes) |
Extract a subfield value as an integer. More... | |
const char * | ExtractStringData (const char *pachData, int nMaxBytes, int *pnConsumedBytes) |
Extract a zero terminated string containing the data for this subfield. More... | |
int | GetDataLength (const char *, int, int *) |
Scan for the end of variable length data. More... | |
void | DumpData (const char *pachData, int nMaxBytes, FILE *fp) |
Dump subfield value to debugging file. More... | |
int | FormatStringValue (char *pachData, int nBytesAvailable, int *pnBytesUsed, const char *pszValue, int nValueLength=-1) |
Format string subfield value. More... | |
int | FormatIntValue (char *pachData, int nBytesAvailable, int *pnBytesUsed, int nNewValue) |
Format int subfield value. More... | |
int | FormatFloatValue (char *pachData, int nBytesAvailable, int *pnBytesUsed, double dfNewValue) |
Format float subfield value. More... | |
int | GetWidth () |
Get the subfield width (zero for variable). More... | |
int | GetDefaultValue (char *pachData, int nBytesAvailable, int *pnBytesUsed) |
Get default data. More... | |
void | Dump (FILE *fp) |
Write out subfield definition info to debugging file. More... | |
DDFBinaryFormat | GetBinaryFormat (void) const |
Private Attributes | |
char * | pszName |
char * | pszFormatString |
DDFDataType | eType |
DDFBinaryFormat | eBinaryFormat |
int | bIsVariable |
char | chFormatDelimeter |
int | nFormatWidth |
int | nMaxBufChars |
char * | pachBuffer |
Information from the DDR record describing one subfield of a DDFFieldDefn.
All subfields of a field will occur in each occurance of that field (as a DDFField) in a DDFRecord. Subfield's actually contain formatted data (as instances within a record).
Definition at line 278 of file ossimIso8211.h.
Binary format: this is the digit immediately following the B or b for binary formats.
Enumerator | |
---|---|
NotBinary | |
UInt | |
SInt | |
FPReal | |
FloatReal | |
FloatComplex |
Definition at line 335 of file ossimIso8211.h.
ossimDDFSubfieldDefn::ossimDDFSubfieldDefn | ( | ) |
Definition at line 41 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, chFormatDelimeter, DDFString, eBinaryFormat, eType, nFormatWidth, nMaxBufChars, NotBinary, OSSIM_DDF_UNIT_TERMINATOR, pachBuffer, pszFormatString, and pszName.
ossimDDFSubfieldDefn::~ossimDDFSubfieldDefn | ( | ) |
Definition at line 62 of file ossimDdfsubfielddefn.cpp.
References pachBuffer, pszFormatString, and pszName.
void ossimDDFSubfieldDefn::Dump | ( | FILE * | fp | ) |
Write out subfield definition info to debugging file.
A variety of information about this field definition is written to the give debugging file handle.
fp | The standard io file handle to write to. ie. stderr |
Definition at line 199 of file ossimDdfsubfielddefn.cpp.
References pszFormatString, and pszName.
void ossimDDFSubfieldDefn::DumpData | ( | const char * | pachData, |
int | nMaxBytes, | ||
FILE * | fp | ||
) |
Dump subfield value to debugging file.
pachData | Pointer to data for this subfield. |
nMaxBytes | Maximum number of bytes available in pachData. |
fp | File to write report to. |
Definition at line 689 of file ossimDdfsubfielddefn.cpp.
References DDFBinaryString, DDFFloat, DDFInt, eType, ExtractFloatData(), ExtractIntData(), ExtractStringData(), min, and pszName.
Referenced by ossimDDFField::Dump().
double ossimDDFSubfieldDefn::ExtractFloatData | ( | const char * | pachSourceData, |
int | nMaxBytes, | ||
int * | pnConsumedBytes | ||
) |
Extract a subfield value as a float.
Given a pointer to the data for this subfield (from within a DDFRecord) this method will return the floating point data for this subfield. The number of bytes consumed as part of this field can also be fetched. This method may be called for any type of subfield, and will return zero if the subfield is not numeric.
pachSourceData | The pointer to the raw data for this field. This may have come from DDFRecord::GetData(), taking into account skip factors over previous subfields data. |
nMaxBytes | The maximum number of bytes that are accessable after pachSourceData. |
pnConsumedBytes | Pointer to an integer into which the number of bytes consumed by this field should be written. May be NULL to ignore. This is used as a skip factor to increment pachSourceData to point to the next subfields data. |
Definition at line 394 of file ossimDdfsubfielddefn.cpp.
References eBinaryFormat, ExtractStringData(), FloatComplex, FloatReal, FPReal, nFormatWidth, NotBinary, pszFormatString, SInt, and UInt.
Referenced by DumpData(), and ossimDDFRecord::GetFloatSubfield().
int ossimDDFSubfieldDefn::ExtractIntData | ( | const char * | pachSourceData, |
int | nMaxBytes, | ||
int * | pnConsumedBytes | ||
) |
Extract a subfield value as an integer.
Given a pointer to the data for this subfield (from within a DDFRecord) this method will return the int data for this subfield. The number of bytes consumed as part of this field can also be fetched. This method may be called for any type of subfield, and will return zero if the subfield is not numeric.
pachSourceData | The pointer to the raw data for this field. This may have come from DDFRecord::GetData(), taking into account skip factors over previous subfields data. |
nMaxBytes | The maximum number of bytes that are accessable after pachSourceData. |
pnConsumedBytes | Pointer to an integer into which the number of bytes consumed by this field should be written. May be NULL to ignore. This is used as a skip factor to increment pachSourceData to point to the next subfields data. |
Definition at line 544 of file ossimDdfsubfielddefn.cpp.
References eBinaryFormat, ExtractStringData(), FloatComplex, FloatReal, FPReal, nFormatWidth, NotBinary, ossimNotify(), ossimNotifyLevel_WARN, pszFormatString, pszName, SInt, and UInt.
Referenced by DumpData(), and ossimDDFRecord::GetIntSubfield().
const char * ossimDDFSubfieldDefn::ExtractStringData | ( | const char * | pachSourceData, |
int | nMaxBytes, | ||
int * | pnConsumedBytes | ||
) |
Extract a zero terminated string containing the data for this subfield.
Given a pointer to the data for this subfield (from within a DDFRecord) this method will return the data for this subfield. The number of bytes consumed as part of this field can also be fetched. This number may be one longer than the string length if there is a terminator character used.
This function will return the raw binary data of a subfield for types other than DDFString, including data past zero chars. This is the standard way of extracting DDFBinaryString subfields for instance.
pachSourceData | The pointer to the raw data for this field. This may have come from DDFRecord::GetData(), taking into account skip factors over previous subfields data. |
nMaxBytes | The maximum number of bytes that are accessable after pachSourceData. |
pnConsumedBytes | Pointer to an integer into which the number of bytes consumed by this field should be written. May be NULL to ignore. This is used as a skip factor to increment pachSourceData to point to the next subfields data. |
Definition at line 338 of file ossimDdfsubfielddefn.cpp.
References GetDataLength(), nMaxBufChars, and pachBuffer.
Referenced by DumpData(), ExtractFloatData(), ExtractIntData(), ossimDDFRecord::GetStringSubfield(), and ossimAdrgHeader::parse().
int ossimDDFSubfieldDefn::FormatFloatValue | ( | char * | pachData, |
int | nBytesAvailable, | ||
int * | pnBytesUsed, | ||
double | dfNewValue | ||
) |
Format float subfield value.
Returns a buffer with the passed in float value reformatted in a way suitable for storage in a DDFField for this subfield.
Definition at line 946 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, GetBinaryFormat(), nFormatWidth, NotBinary, and OSSIM_DDF_UNIT_TERMINATOR.
Referenced by ossimDDFRecord::SetFloatSubfield().
int ossimDDFSubfieldDefn::FormatIntValue | ( | char * | pachData, |
int | nBytesAvailable, | ||
int * | pnBytesUsed, | ||
int | nNewValue | ||
) |
Format int subfield value.
Returns a buffer with the passed in int value reformatted in a way suitable for storage in a DDFField for this subfield.
Definition at line 857 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, FloatReal, GetBinaryFormat(), nFormatWidth, NotBinary, OSSIM_DDF_UNIT_TERMINATOR, pszFormatString, SInt, and UInt.
Referenced by ossimDDFRecord::SetIntSubfield().
int ossimDDFSubfieldDefn::FormatStringValue | ( | char * | pachData, |
int | nBytesAvailable, | ||
int * | pnBytesUsed, | ||
const char * | pszValue, | ||
int | nValueLength = -1 |
||
) |
Format string subfield value.
Returns a buffer with the passed in string value reformatted in a way suitable for storage in a DDFField for this subfield.
Definition at line 795 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, GetBinaryFormat(), min, nFormatWidth, NotBinary, and OSSIM_DDF_UNIT_TERMINATOR.
Referenced by ossimDDFRecord::SetStringSubfield().
|
inline |
Definition at line 344 of file ossimIso8211.h.
References eBinaryFormat.
Referenced by FormatFloatValue(), FormatIntValue(), FormatStringValue(), and GetDefaultValue().
int ossimDDFSubfieldDefn::GetDataLength | ( | const char * | pachSourceData, |
int | nMaxBytes, | ||
int * | pnConsumedBytes | ||
) |
Scan for the end of variable length data.
Given a pointer to the data for this subfield (from within a DDFRecord) this method will return the number of bytes which are data for this subfield. The number of bytes consumed as part of this field can also be fetched. This number may be one longer than the length if there is a terminator character used.
This method is mainly for internal use, or for applications which want the raw binary data to interpret themselves. Otherwise use one of ExtractStringData(), ExtractIntData() or ExtractFloatData().
pachSourceData | The pointer to the raw data for this field. This may have come from DDFRecord::GetData(), taking into account skip factors over previous subfields data. |
nMaxBytes | The maximum number of bytes that are accessable after pachSourceData. |
pnConsumedBytes | Pointer to an integer into which the number of bytes consumed by this field should be written. May be NULL to ignore. |
Definition at line 237 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, chFormatDelimeter, nFormatWidth, OSSIM_DDF_FIELD_TERMINATOR, ossimNotify(), ossimNotifyLevel_WARN, pszFormatString, and pszName.
Referenced by ossimDDFField::Dump(), ExtractStringData(), ossimDDFField::GetInstanceData(), ossimDDFField::GetRepeatCount(), ossimDDFField::GetSubfieldData(), ossimDDFRecord::SetFloatSubfield(), ossimDDFRecord::SetIntSubfield(), and ossimDDFRecord::SetStringSubfield().
int ossimDDFSubfieldDefn::GetDefaultValue | ( | char * | pachData, |
int | nBytesAvailable, | ||
int * | pnBytesUsed | ||
) |
Get default data.
Returns the default subfield data contents for this subfield definition. For variable length numbers this will normally be "0<unit-terminator>". For variable length strings it will be "<unit-terminator>". For fixed length numbers it is zero filled. For fixed length strings it is space filled. For binary numbers it is binary zero filled.
pachData | the buffer into which the returned default will be placed. May be NULL if just querying default size. |
nBytesAvailable | the size of pachData in bytes. |
pnBytesUsed | will receive the size of the subfield default data in bytes. |
Definition at line 744 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, DDFFloat, DDFInt, GetBinaryFormat(), GetType(), nFormatWidth, NotBinary, and OSSIM_DDF_UNIT_TERMINATOR.
|
inline |
Get pointer to subfield format string.
Definition at line 291 of file ossimIso8211.h.
References pszFormatString.
Referenced by ossimDDFFieldDefn::AddSubfield().
|
inline |
Get pointer to subfield name.
Definition at line 288 of file ossimIso8211.h.
References pszName.
Referenced by ossimDDFFieldDefn::AddSubfield(), and ossimDDFFieldDefn::FindSubfieldDefn().
|
inline |
Get the general type of the subfield.
This can be used to determine which of ExtractFloatData(), ExtractIntData() or ExtractStringData() should be used.
Definition at line 302 of file ossimIso8211.h.
References eType.
Referenced by GetDefaultValue().
|
inline |
Get the subfield width (zero for variable).
Definition at line 324 of file ossimIso8211.h.
References nFormatWidth.
Referenced by ossimDDFFieldDefn::ApplyFormats(), and ossimDDFField::GetRepeatCount().
int ossimDDFSubfieldDefn::SetFormat | ( | const char * | pszFormat | ) |
Definition at line 98 of file ossimDdfsubfielddefn.cpp.
References bIsVariable, DDFBinaryString, DDFFloat, DDFInt, DDFString, eBinaryFormat, eType, nFormatWidth, ossimNotify(), ossimNotifyLevel_WARN, pszFormatString, SInt, and UInt.
Referenced by ossimDDFFieldDefn::AddSubfield().
void ossimDDFSubfieldDefn::SetName | ( | const char * | pszName | ) |
Definition at line 74 of file ossimDdfsubfielddefn.cpp.
References pszName.
Referenced by ossimDDFFieldDefn::AddSubfield(), and ossimDDFFieldDefn::BuildSubfields().
|
private |
Definition at line 359 of file ossimIso8211.h.
Referenced by FormatFloatValue(), FormatIntValue(), FormatStringValue(), GetDataLength(), GetDefaultValue(), ossimDDFSubfieldDefn(), and SetFormat().
|
private |
Definition at line 361 of file ossimIso8211.h.
Referenced by GetDataLength(), and ossimDDFSubfieldDefn().
|
private |
Definition at line 353 of file ossimIso8211.h.
Referenced by ExtractFloatData(), ExtractIntData(), GetBinaryFormat(), ossimDDFSubfieldDefn(), and SetFormat().
|
private |
Definition at line 352 of file ossimIso8211.h.
Referenced by DumpData(), GetType(), ossimDDFSubfieldDefn(), and SetFormat().
|
private |
Definition at line 362 of file ossimIso8211.h.
Referenced by ExtractFloatData(), ExtractIntData(), FormatFloatValue(), FormatIntValue(), FormatStringValue(), GetDataLength(), GetDefaultValue(), GetWidth(), ossimDDFSubfieldDefn(), and SetFormat().
|
private |
Definition at line 368 of file ossimIso8211.h.
Referenced by ExtractStringData(), and ossimDDFSubfieldDefn().
|
private |
Definition at line 369 of file ossimIso8211.h.
Referenced by ExtractStringData(), ossimDDFSubfieldDefn(), and ~ossimDDFSubfieldDefn().
|
private |
Definition at line 350 of file ossimIso8211.h.
Referenced by Dump(), ExtractFloatData(), ExtractIntData(), FormatIntValue(), GetDataLength(), GetFormat(), ossimDDFSubfieldDefn(), SetFormat(), and ~ossimDDFSubfieldDefn().
|
private |
Definition at line 349 of file ossimIso8211.h.
Referenced by Dump(), DumpData(), ExtractIntData(), GetDataLength(), GetName(), ossimDDFSubfieldDefn(), SetName(), and ~ossimDDFSubfieldDefn().