30 #ifndef _ISO8211_H_INCLUDED
31 #define _ISO8211_H_INCLUDED
51 long CPL_ODLL DDFScanInt(
const char *pszString,
int nMaxChars );
52 int CPL_ODLL DDFScanVariable(
const char * pszString,
int nMaxChars,
int nDelimChar );
53 char CPL_ODLL *DDFFetchVariable(
const char *pszString,
int nMaxChars,
54 int nDelimChar1,
int nDelimChar2,
55 int *pnConsumedChars );
57 #define DDF_FIELD_TERMINATOR 30
58 #define DDF_UNIT_TERMINATOR 31
86 int Open(
const char * pszFilename,
int bFailQuietly = FALSE );
87 int Create(
const char *pszFilename );
90 int Initialize(
char chInterchangeLevel =
'3',
91 char chLeaderIden =
'L',
92 char chCodeExtensionIndicator =
'E',
93 char chVersionNumber =
'1',
94 char chAppIndicator =
' ',
95 const char *pszExtendedCharSet =
" ! ",
96 int nSizeFieldLength = 3,
97 int nSizeFieldPos = 4,
98 int nSizeFieldTag = 4 );
100 void Dump( FILE * fp );
103 void Rewind(
long nOffset = -1 );
114 int GetFieldControlLength() {
return _fieldControlLength; }
119 VSILFILE *GetFP() {
return fpDDF; }
120 int GetSizeFieldTag()
const {
return (
int)_sizeFieldTag; }
125 long nFirstRecordOffset;
127 char _interchangeLevel;
128 char _inlineCodeExtensionIndicator;
131 int _fieldControlLength;
132 char _extendedCharSet[4];
136 long _fieldAreaStart;
137 long _sizeFieldLength;
156 typedef enum { dsc_elementary, dsc_vector, dsc_array, dsc_concatenated } DDF_data_struct_code;
157 typedef enum { dtc_char_string,
160 dtc_explicit_point_scaled,
163 dtc_mixed_data_type } DDF_data_type_code;
178 int Create(
const char *pszTag,
const char *pszFieldName,
179 const char *pszDescription,
180 DDF_data_struct_code eDataStructCode,
181 DDF_data_type_code eDataTypeCode,
182 const char *pszFormat = NULL );
184 int bDontAddToFormat = FALSE );
185 void AddSubfield(
const char *pszName,
const char *pszFormat );
186 int GenerateDDREntry(
char **ppachData,
int *pnLength );
188 int Initialize(
DDFModule * poModule,
const char *pszTag,
189 int nSize,
const char * pachRecord );
191 void Dump( FILE * fp );
225 static char *ExpandFormat(
const char * );
230 char *GetDefaultValue(
int *pnSize );
232 const char *GetArrayDescr()
const {
return _arrayDescr; }
233 const char *GetFormatControls()
const {
return _formatControls; }
234 DDF_data_struct_code GetDataStructCode()
const {
return _data_struct_code; }
235 DDF_data_type_code GetDataTypeCode()
const {
return _data_type_code; }
239 static char *ExtractSubstring(
const char * );
246 char * _formatControls;
248 int bRepeatingSubfields;
251 int BuildSubfields();
254 DDF_data_struct_code _data_struct_code;
256 DDF_data_type_code _data_type_code;
283 void SetName(
const char * pszName );
290 int SetFormat(
const char * pszFormat );
302 double ExtractFloatData(
const char *pachData,
int nMaxBytes,
303 int * pnConsumedBytes );
304 int ExtractIntData(
const char *pachData,
int nMaxBytes,
305 int * pnConsumedBytes );
306 const char *ExtractStringData(
const char *pachData,
int nMaxBytes,
307 int * pnConsumedBytes );
308 int GetDataLength(
const char *,
int,
int * );
309 void DumpData(
const char *pachData,
int nMaxBytes, FILE * fp );
311 int FormatStringValue(
char *pachData,
int nBytesAvailable,
312 int *pnBytesUsed,
const char *pszValue,
313 int nValueLength = -1 );
315 int FormatIntValue(
char *pachData,
int nBytesAvailable,
316 int *pnBytesUsed,
int nNewValue );
318 int FormatFloatValue(
char *pachData,
int nBytesAvailable,
319 int *pnBytesUsed,
double dfNewValue );
324 int GetDefaultValue(
char *pachData,
int nBytesAvailable,
327 void Dump( FILE * fp );
342 DDFBinaryFormat GetBinaryFormat(
void)
const {
return eBinaryFormat; }
348 char *pszFormatString;
351 DDFBinaryFormat eBinaryFormat;
359 char chFormatDelimeter;
397 DDFField *FindField(
const char *,
int = 0 );
400 int GetIntSubfield(
const char *,
int,
const char *,
int,
402 double GetFloatSubfield(
const char *,
int,
const char *,
int,
404 const char *GetStringSubfield(
const char *,
int,
const char *,
int,
407 int SetIntSubfield(
const char *pszField,
int iFieldIndex,
408 const char *pszSubfield,
int iSubfieldIndex,
410 int SetStringSubfield(
const char *pszField,
int iFieldIndex,
411 const char *pszSubfield,
int iSubfieldIndex,
412 const char *pszValue,
int nValueLength=-1 );
413 int SetFloatSubfield(
const char *pszField,
int iFieldIndex,
414 const char *pszSubfield,
int iSubfieldIndex,
433 int ResizeField(
DDFField *poField,
int nNewDataSize );
434 int DeleteField(
DDFField *poField );
437 int CreateDefaultFieldInstance(
DDFField *poField,
int iIndexWithinField );
439 int SetFieldRaw(
DDFField *poField,
int iIndexWithinField,
440 const char *pachRawData,
int nRawDataSize );
441 int UpdateFieldRaw(
DDFField *poField,
int iIndexWithinField,
442 int nStartOffset,
int nOldSize,
443 const char *pachRawData,
int nRawDataSize );
450 int ResetDirectory();
464 int _sizeFieldLength;
496 void Dump( FILE * fp );
499 int * = NULL,
int = 0 );
501 const char *GetInstanceData(
int nInstance,
int *pnSize );
512 int GetRepeatCount();
522 const char *pachData;
int GetSubfieldCount()
Definition: iso8211.h:204
DDFModule * GetModule()
Definition: iso8211.h:431
Definition: iso8211.h:490
DDFDataType GetType()
Definition: iso8211.h:300
const char * GetData()
Definition: iso8211.h:507
const char * GetData()
Definition: iso8211.h:425
DDFFieldDefn * GetFieldDefn()
Definition: iso8211.h:515
void SetRepeatingFlag(int n)
Definition: iso8211.h:228
int GetDataSize()
Definition: iso8211.h:418
const char * GetName()
Definition: iso8211.h:286
Definition: iso8211.h:172
int IsRepeating()
Definition: iso8211.h:223
Definition: iso8211.h:276
int GetDataSize()
Definition: iso8211.h:510
int GetFixedWidth()
Definition: iso8211.h:216
const char * GetFormat()
Definition: iso8211.h:289
int GetWidth()
Definition: iso8211.h:322
const char * GetName()
Definition: iso8211.h:196
int GetFieldCount()
Definition: iso8211.h:395
Definition: iso8211.h:383
const char * GetDescription()
Definition: iso8211.h:201
int GetFieldCount()
Definition: iso8211.h:109