32 #ifndef ossimIso8211_HEADER 33 #define ossimIso8211_HEADER 56 int nMaxChars,
int nDelimChar );
58 int nDelimChar1,
int nDelimChar2,
59 int *pnConsumedChars );
61 #ifndef OSSIM_DDF_FIELD_TERMINATOR 62 # define OSSIM_DDF_FIELD_TERMINATOR 30 64 #ifndef OSSIM_DDF_UNIT_TERMINATOR 65 # define OSSIM_DDF_UNIT_TERMINATOR 31 94 int Open(
const char * pszFilename,
int bFailQuietly =
false );
95 int Create(
const char *pszFilename );
99 char chLeaderIden =
'L',
100 char chCodeExtensionIndicator =
'E',
101 char chVersionNumber =
'1',
102 char chAppIndicator =
' ',
103 const char *pszExtendedCharSet =
" ! ",
104 int nSizeFieldLength = 3,
105 int nSizeFieldPos = 4,
106 int nSizeFieldTag = 4 );
108 void Dump( FILE * fp );
111 void Rewind(
long nOffset = -1 );
185 int Create(
const char *
pszTag,
const char *pszFieldName,
186 const char *pszDescription,
189 const char *pszFormat = NULL );
191 int bDontAddToFormat =
false );
192 void AddSubfield(
const char *pszName,
const char *pszFormat );
196 int nSize,
const char * pachRecord );
198 void Dump( FILE * fp );
305 int * pnConsumedBytes );
307 int * pnConsumedBytes );
309 int * pnConsumedBytes );
311 void DumpData(
const char *pachData,
int nMaxBytes, FILE * fp );
314 int *pnBytesUsed,
const char *pszValue,
315 int nValueLength = -1 );
318 int *pnBytesUsed,
int nNewValue );
321 int *pnBytesUsed,
double dfNewValue );
329 void Dump( FILE * fp );
410 const char *pszSubfield,
int iSubfieldIndex,
413 const char *pszSubfield,
int iSubfieldIndex,
414 const char *pszValue,
int nValueLength=-1 );
416 const char *pszSubfield,
int iSubfieldIndex,
442 const char *pachRawData,
int nRawDataSize );
444 int nStartOffset,
int nOldSize,
445 const char *pachRawData,
int nRawDataSize );
498 void Dump( FILE * fp );
501 int * = NULL,
int = 0 );
int GetDefaultValue(char *pachData, int nBytesAvailable, int *pnBytesUsed)
Get default data.
const char * GetName()
Get pointer to subfield name.
void Dump(FILE *)
Write out record contents to debugging file.
void Initialize(ossimDDFFieldDefn *, const char *pszData, int nSize)
int GetFieldCount()
Fetch the number of defined fields.
ossimDDFModule()
The constructor.
const char * ExtractStringData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a zero terminated string containing the data for this subfield.
void RemoveCloneRecord(ossimDDFRecord *)
static char * ExtractSubstring(const char *)
Information from the DDR defining one field.
int FormatFloatValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, double dfNewValue)
Format float subfield value.
int GetDataSize()
Return the number of bytes in the data block returned by GetData().
double ExtractFloatData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a subfield value as a float.
const char * GetName()
Fetch a pointer to the field name (tag).
char * GetDefaultValue(int *pnSize)
Return default data for field instance.
ossimDDFModule * poModule
int Initialize(ossimDDFModule *poModule, const char *pszTag, int nSize, const char *pachRecord)
int Create(const char *pszFilename)
char * ossimDDFFetchVariable(const char *pszString, int nMaxChars, int nDelimChar1, int nDelimChar2, int *pnConsumedChars)
int FormatStringValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, const char *pszValue, int nValueLength=-1)
Format string subfield value.
int GetDataSize()
Fetch size of records raw data (GetData()) in bytes.
int UpdateFieldRaw(ossimDDFField *poField, int iIndexWithinField, int nStartOffset, int nOldSize, const char *pachRawData, int nRawDataSize)
void Dump(FILE *fp)
Write out subfield definition info to debugging file.
ossimDDFSubfieldDefn ** papoSubfields
int GetFieldControlLength()
static char * ExpandFormat(const char *)
int GenerateDDREntry(char **ppachData, int *pnLength)
int ossimDDFScanVariable(const char *pszString, int nMaxChars, int nDelimChar)
ossimDDFField * FindField(const char *, int=0)
Find the named field within this record.
int SetStringSubfield(const char *pszField, int iFieldIndex, const char *pszSubfield, int iSubfieldIndex, const char *pszValue, int nValueLength=-1)
Set a string subfield in record.
ossimDDFRecord * Clone()
Make a copy of a record.
ossimDDFRecord * poRecord
int CreateDefaultFieldInstance(ossimDDFField *poField, int iIndexWithinField)
Initialize default instance.
int SetFloatSubfield(const char *pszField, int iFieldIndex, const char *pszSubfield, int iSubfieldIndex, double dfNewValue)
Set a float subfield in record.
void Dump(FILE *fp)
Write out module info to debugging file.
~ossimDDFModule()
The destructor.
const char * GetSubfieldData(ossimDDFSubfieldDefn *, int *=NULL, int=0)
Fetch raw data pointer for a particular subfield of this field.
ossimDDFFieldDefn * FindFieldDefn(const char *)
Fetch the definition of the named field.
ossimDDFRecord ** papoClones
ossimDDFField * GetField(int)
Fetch field object based on index.
int FormatIntValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, int nNewValue)
Format int subfield value.
double GetFloatSubfield(const char *, int, const char *, int, int *=NULL)
Fetch value of a subfield as a float (double).
void AddSubfield(ossimDDFSubfieldDefn *poNewSFDefn, int bDontAddToFormat=false)
This object represents one field in a DDFRecord.
int DeleteField(ossimDDFField *poField)
Delete a field instance from a record.
ossimDDFRecord(ossimDDFModule *)
void Dump(FILE *fp)
Write out field definition info to debugging file.
ossimDDFField * paoFields
os2<< "> n<< " > nendobj n
int GetRepeatCount()
How many times do the subfields of this record repeat? This will always be one for non-repeating fie...
int Write()
Write record out to module.
int SetFieldRaw(ossimDDFField *poField, int iIndexWithinField, const char *pachRawData, int nRawDataSize)
Set the raw contents of a field instance.
ossimDDFFieldDefn ** papoFieldDefns
ossimDDFSubfieldDefn * FindSubfieldDefn(const char *)
Find a subfield definition by it's mnemonic tag.
void SetName(const char *pszName)
ossimDDFField * AddField(ossimDDFFieldDefn *)
Add a new field to record.
const char * GetStringSubfield(const char *, int, const char *, int, int *=NULL)
Fetch value of a subfield as a string.
int ResizeField(ossimDDFField *poField, int nNewDataSize)
Alter field data size within record.
int GetFixedWidth()
Get the width of this field.
const char * GetData()
Return the pointer to the entire data block for this record.
ossimDDFModule * poModule
DDF_data_type_code _data_type_code
void Rewind(long nOffset=-1)
Return to first record.
const char * GetInstanceData(int nInstance, int *pnSize)
Get field instance data and size.
int SetIntSubfield(const char *pszField, int iFieldIndex, const char *pszSubfield, int iSubfieldIndex, int nValue)
Set an integer subfield in record.
int GetSubfieldCount()
Get the number of subfields.
void AddField(ossimDDFFieldDefn *poNewFDefn)
Add new field definition.
int GetFieldCount()
Get the number of DDFFields on this record.
void Dump(FILE *fp)
Write out field contents to debugging file.
int GetIntSubfield(const char *, int, const char *, int, int *=NULL)
Fetch value of a subfield as an integer.
ossimDDFFieldDefn * GetField(int)
Fetch a field definition by index.
DDF_data_struct_code _data_struct_code
ossimDDFFieldDefn * GetFieldDefn()
Fetch the corresponding DDFFieldDefn.
int ExtractIntData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a subfield value as an integer.
void Close()
Close an ISO 8211 file.
int Open(const char *pszFilename, int bFailQuietly=false)
Open a ISO 8211 (DDF) file for reading.
The primary class for reading ISO 8211 files.
int GetDataLength(const char *, int, int *)
Scan for the end of variable length data.
DDFBinaryFormat eBinaryFormat
char _inlineCodeExtensionIndicator
ossimDDFRecord * ReadRecord(void)
Read one record from the file.
long ossimDDFScanInt(const char *pszString, int nMaxChars)
ossimDDFRecord * CloneOn(ossimDDFModule *)
Recreate a record referencing another module.
Contains instance data from one data record (DR).
DDFBinaryFormat
Binary format: this is the digit immediately following the B or b for binary formats.
int Create(const char *pszTag, const char *pszFieldName, const char *pszDescription, DDF_data_struct_code eDataStructCode, DDF_data_type_code eDataTypeCode, const char *pszFormat=NULL)
int GetWidth()
Get the subfield width (zero for variable).
int Initialize(char chInterchangeLevel='3', char chLeaderIden='L', char chCodeExtensionIndicator='E', char chVersionNumber='1', char chAppIndicator=' ', const char *pszExtendedCharSet=" ! ", int nSizeFieldLength=3, int nSizeFieldPos=4, int nSizeFieldTag=4)
const char * GetFormat()
Get pointer to subfield format string.
void DumpData(const char *pachData, int nMaxBytes, FILE *fp)
Dump subfield value to debugging file.
int SetFormat(const char *pszFormat)
DDFBinaryFormat GetBinaryFormat(void) const
void AddCloneRecord(ossimDDFRecord *)
int IsRepeating()
Fetch repeating flag.
ossimDDFSubfieldDefn * GetSubfield(int i)
Fetch a subfield by index.
Information from the DDR record describing one subfield of a DDFFieldDefn.
ossimDDFFieldDefn * poDefn
const char * GetDescription()
Fetch a longer descriptio of this field.
const char * GetData()
Fetch the raw data for this record.
DDFDataType GetType()
Get the general type of the subfield.
void SetRepeatingFlag(int n)
this is just for an S-57 hack for swedish data
ossimDDFModule * GetModule()
Fetch the DDFModule with which this record is associated.
DDFDataType
General data type.