30 #ifndef ISO8211_H_INCLUDED 31 #define ISO8211_H_INCLUDED 51 int 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 85 int Open(
const char * pszFilename,
int bFailQuietly = FALSE );
86 int Create(
const char *pszFilename );
89 int Initialize(
char chInterchangeLevel =
'3',
90 char chLeaderIden =
'L',
91 char chCodeExtensionIndicator =
'E',
92 char chVersionNumber =
'1',
93 char chAppIndicator =
' ',
94 const char *pszExtendedCharSet =
" ! ",
95 int nSizeFieldLength = 3,
96 int nSizeFieldPos = 4,
97 int nSizeFieldTag = 4 );
99 void Dump( FILE * fp );
102 void Rewind(
long nOffset = -1 );
113 int GetFieldControlLength() {
return _fieldControlLength; }
118 VSILFILE *GetFP() {
return fpDDF; }
119 int GetSizeFieldTag()
const {
return (
int)_sizeFieldTag; }
122 int GetSizeFieldPos()
const {
return _sizeFieldPos; }
123 int GetSizeFieldLength()
const {
return _sizeFieldLength; }
124 char GetInterchangeLevel()
const {
return _interchangeLevel; }
125 char GetLeaderIden()
const {
return _leaderIden; }
126 char GetCodeExtensionIndicator()
const {
return _inlineCodeExtensionIndicator; }
127 char GetVersionNumber()
const {
return _versionNumber; }
128 char GetAppIndicator()
const {
return _appIndicator; }
129 const char* GetExtendedCharSet()
const {
return _extendedCharSet; }
130 void SetFieldControlLength(
int nVal) { _fieldControlLength = nVal; }
136 long nFirstRecordOffset;
138 char _interchangeLevel;
139 char _inlineCodeExtensionIndicator;
142 int _fieldControlLength;
143 char _extendedCharSet[4];
148 int _sizeFieldLength;
167 typedef enum { dsc_elementary, dsc_vector, dsc_array, dsc_concatenated } DDF_data_struct_code;
168 typedef enum { dtc_char_string,
171 dtc_explicit_point_scaled,
174 dtc_mixed_data_type } DDF_data_type_code;
189 int Create(
const char *pszTag,
const char *pszFieldName,
190 const char *pszDescription,
191 DDF_data_struct_code eDataStructCode,
192 DDF_data_type_code eDataTypeCode,
193 const char *pszFormat = NULL );
195 int bDontAddToFormat = FALSE );
196 void AddSubfield(
const char *pszName,
const char *pszFormat );
197 int GenerateDDREntry(
DDFModule * poModule,
char **ppachData,
int *pnLength );
199 int Initialize(
DDFModule * poModule,
const char *pszTag,
200 int nSize,
const char * pachRecord );
202 void Dump( FILE * fp );
236 static char *ExpandFormat(
const char * );
241 char *GetDefaultValue(
int *pnSize );
243 const char *GetArrayDescr()
const {
return _arrayDescr; }
244 const char *GetFormatControls()
const {
return _formatControls; }
245 DDF_data_struct_code GetDataStructCode()
const {
return _data_struct_code; }
246 DDF_data_type_code GetDataTypeCode()
const {
return _data_type_code; }
248 void SetFormatControls(
const char* pszVal);
252 static char *ExtractSubstring(
const char * );
259 char * _formatControls;
261 int bRepeatingSubfields;
264 int BuildSubfields();
267 DDF_data_struct_code _data_struct_code;
269 DDF_data_type_code _data_type_code;
296 void SetName(
const char * pszName );
303 int SetFormat(
const char * pszFormat );
315 double ExtractFloatData(
const char *pachData,
int nMaxBytes,
316 int * pnConsumedBytes );
317 int ExtractIntData(
const char *pachData,
int nMaxBytes,
318 int * pnConsumedBytes );
319 const char *ExtractStringData(
const char *pachData,
int nMaxBytes,
320 int * pnConsumedBytes );
321 int GetDataLength(
const char *,
int,
int * );
322 void DumpData(
const char *pachData,
int nMaxBytes, FILE * fp );
324 int FormatStringValue(
char *pachData,
int nBytesAvailable,
325 int *pnBytesUsed,
const char *pszValue,
326 int nValueLength = -1 );
328 int FormatIntValue(
char *pachData,
int nBytesAvailable,
329 int *pnBytesUsed,
int nNewValue );
331 int FormatFloatValue(
char *pachData,
int nBytesAvailable,
332 int *pnBytesUsed,
double dfNewValue );
337 int GetDefaultValue(
char *pachData,
int nBytesAvailable,
340 void Dump( FILE * fp );
361 char *pszFormatString;
372 char chFormatDelimiter;
410 DDFField *FindField(
const char *,
int = 0 );
413 int GetIntSubfield(
const char *,
int,
const char *,
int,
415 double GetFloatSubfield(
const char *,
int,
const char *,
int,
417 const char *GetStringSubfield(
const char *,
int,
const char *,
int,
420 int SetIntSubfield(
const char *pszField,
int iFieldIndex,
421 const char *pszSubfield,
int iSubfieldIndex,
423 int SetStringSubfield(
const char *pszField,
int iFieldIndex,
424 const char *pszSubfield,
int iSubfieldIndex,
425 const char *pszValue,
int nValueLength=-1 );
426 int SetFloatSubfield(
const char *pszField,
int iFieldIndex,
427 const char *pszSubfield,
int iSubfieldIndex,
446 int ResizeField(
DDFField *poField,
int nNewDataSize );
447 int DeleteField(
DDFField *poField );
450 int CreateDefaultFieldInstance(
DDFField *poField,
int iIndexWithinField );
452 int SetFieldRaw(
DDFField *poField,
int iIndexWithinField,
453 const char *pachRawData,
int nRawDataSize );
454 int UpdateFieldRaw(
DDFField *poField,
int iIndexWithinField,
455 int nStartOffset,
int nOldSize,
456 const char *pachRawData,
int nRawDataSize );
461 int GetReuseHeader()
const {
return nReuseHeader; }
462 int GetSizeFieldTag()
const {
return _sizeFieldTag; }
463 int GetSizeFieldPos()
const {
return _sizeFieldPos; }
464 int GetSizeFieldLength()
const {
return _sizeFieldLength; }
466 void SetSizeFieldTag(
int nVal) { _sizeFieldTag = nVal; }
467 void SetSizeFieldPos(
int nVal) { _sizeFieldPos = nVal; }
468 void SetSizeFieldLength(
int nVal) { _sizeFieldLength = nVal; }
473 int ResetDirectory();
474 void RemoveIsCloneFlag() { bIsClone = FALSE; }
488 int _sizeFieldLength;
520 void Dump( FILE * fp );
523 int * = NULL,
int = 0 );
525 const char *GetInstanceData(
int nInstance,
int *pnSize );
536 int GetRepeatCount();
546 const char *pachData;
int GetSubfieldCount()
Definition: iso8211.h:215
DDFModule * GetModule()
Definition: iso8211.h:444
Definition: iso8211.h:514
DDFDataType GetType()
Definition: iso8211.h:313
const char * GetData()
Definition: iso8211.h:531
const char * GetData()
Definition: iso8211.h:438
DDFFieldDefn * GetFieldDefn()
Definition: iso8211.h:539
DDFBinaryFormat
Definition: iso8211.h:346
void SetRepeatingFlag(int n)
Definition: iso8211.h:239
int GetDataSize()
Definition: iso8211.h:431
const char * GetName()
Definition: iso8211.h:299
Definition: iso8211.h:183
int IsRepeating()
Definition: iso8211.h:234
Definition: iso8211.h:289
int GetDataSize()
Definition: iso8211.h:534
int GetFixedWidth()
Definition: iso8211.h:227
const char * GetFormat()
Definition: iso8211.h:302
int GetWidth()
Definition: iso8211.h:335
const char * GetName()
Definition: iso8211.h:207
int GetFieldCount()
Definition: iso8211.h:408
Definition: iso8211.h:396
const char * GetDescription()
Definition: iso8211.h:212
int GetFieldCount()
Definition: iso8211.h:108