OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDdffielddefn.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Copied from "gdal" project. See licence below.
3  *
4  * Project: ISO 8211 Access
5  * Purpose: Implements the DDFFieldDefn class.
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 1999, Frank Warmerdam
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ******************************************************************************
29  * $Id: ossimDdffielddefn.cpp 23346 2015-05-29 13:13:12Z dburken $
30  */
31 
32 #include <cstring>
36 #include <ossim/base/ossimTrace.h>
37 #include <ctype.h>
38 
39 // Static trace for debugging
40 static ossimTrace traceDebug("ossimDDFFieldDefn:debug");
41 
42 
43 /************************************************************************/
44 /* DDFFieldDefn() */
45 /************************************************************************/
46 
48 
49 {
50  poModule = NULL;
51  pszTag = NULL;
52  _fieldName = NULL;
53  _arrayDescr = NULL;
54  _formatControls = NULL;
55  nSubfieldCount = 0;
56  papoSubfields = NULL;
57  bRepeatingSubfields = false;
58  nFixedWidth = 0;
59 }
60 
61 /************************************************************************/
62 /* ~DDFFieldDefn() */
63 /************************************************************************/
64 
66 
67 {
68  int i;
69 
70  free( pszTag );
71  free( _fieldName );
72  free( _arrayDescr );
73  free( _formatControls );
74 
75  for( i = 0; i < nSubfieldCount; i++ )
76  delete papoSubfields[i];
77  free( papoSubfields );
78 }
79 
80 /************************************************************************/
81 /* AddSubfield() */
82 /************************************************************************/
83 
84 void ossimDDFFieldDefn::AddSubfield( const char *pszName,
85  const char *pszFormat )
86 
87 {
89 
90  poSFDefn->SetName( pszName );
91  poSFDefn->SetFormat( pszFormat );
92  AddSubfield( poSFDefn );
93 }
94 
95 /************************************************************************/
96 /* AddSubfield() */
97 /************************************************************************/
98 
100  int bDontAddToFormat )
101 
102 {
103  nSubfieldCount++;
105  realloc( papoSubfields, sizeof(void*) * nSubfieldCount );
106  papoSubfields[nSubfieldCount-1] = poNewSFDefn;
107 
108  if( bDontAddToFormat )
109  return;
110 
111 /* -------------------------------------------------------------------- */
112 /* Add this format to the format list. We don't bother */
113 /* aggregating formats here. */
114 /* -------------------------------------------------------------------- */
115  if( _formatControls == NULL || strlen(_formatControls) == 0 )
116  {
117  free( _formatControls );
118  _formatControls = strdup( "()" );
119  }
120 
121  int nOldLen = (int)strlen(_formatControls);
122 
123  char *pszNewFormatControls = (char *)
124  malloc(nOldLen+3+strlen(poNewSFDefn->GetFormat()));
125 
126  strcpy( pszNewFormatControls, _formatControls );
127  pszNewFormatControls[nOldLen-1] = '\0';
128  if( pszNewFormatControls[nOldLen-2] != '(' )
129  strcat( pszNewFormatControls, "," );
130 
131  strcat( pszNewFormatControls, poNewSFDefn->GetFormat() );
132  strcat( pszNewFormatControls, ")" );
133 
134  free( _formatControls );
135  _formatControls = pszNewFormatControls;
136 
137 /* -------------------------------------------------------------------- */
138 /* Add the subfield name to the list. */
139 /* -------------------------------------------------------------------- */
140  if( _arrayDescr == NULL )
141  _arrayDescr = strdup("");
142 
143  _arrayDescr = (char *)
144  realloc(_arrayDescr,
145  strlen(_arrayDescr)+strlen(poNewSFDefn->GetName())+2);
146  if( strlen(_arrayDescr) > 0 )
147  strcat( _arrayDescr, "!" );
148  strcat( _arrayDescr, poNewSFDefn->GetName() );
149 }
150 
151 /************************************************************************/
152 /* Create() */
153 /* */
154 /* Initialize a new field defn from application input, instead */
155 /* of from an existing file. */
156 /************************************************************************/
157 
158 int ossimDDFFieldDefn::Create( const char *pszTag, const char *pszFieldName,
159  const char *pszDescription,
160  DDF_data_struct_code eDataStructCode,
161  DDF_data_type_code eDataTypeCode,
162  const char *pszFormat )
163 
164 {
165  // assert( this->pszTag == NULL );
166  poModule = NULL;
167  this->pszTag = strdup( pszTag );
168  _fieldName = strdup( pszFieldName );
169  _arrayDescr = strdup( pszDescription );
170  _formatControls = strdup( "" );
171 
172  _data_struct_code = eDataStructCode;
173  _data_type_code = eDataTypeCode;
174 
175  if( pszFormat != NULL )
176  _formatControls = strdup( pszFormat );
177 
178  if( pszDescription != NULL && *pszDescription == '*' )
179  bRepeatingSubfields = true;
180 
181  return true;
182 }
183 
184 /************************************************************************/
185 /* GenerateDDREntry() */
186 /************************************************************************/
187 
188 int ossimDDFFieldDefn::GenerateDDREntry( char **ppachData,
189  int *pnLength )
190 
191 {
192  *pnLength = 9 + (int)strlen(_fieldName) + 1
193  + (int)strlen(_arrayDescr) + 1
194  + (int)strlen(_formatControls) + 1;
195 
196  if( strlen(_formatControls) == 0 )
197  *pnLength -= 1;
198 
199  if( ppachData == NULL )
200  return true;
201 
202  *ppachData = (char *) malloc( *pnLength+1 );
203 
205  (*ppachData)[0] = '0';
206  else if( _data_struct_code == dsc_vector )
207  (*ppachData)[0] = '1';
208  else if( _data_struct_code == dsc_array )
209  (*ppachData)[0] = '2';
210  else if( _data_struct_code == dsc_concatenated )
211  (*ppachData)[0] = '3';
212 
214  (*ppachData)[1] = '0';
215  else if( _data_type_code == dtc_implicit_point )
216  (*ppachData)[1] = '1';
217  else if( _data_type_code == dtc_explicit_point )
218  (*ppachData)[1] = '2';
220  (*ppachData)[1] = '3';
222  (*ppachData)[1] = '4';
223  else if( _data_type_code == dtc_bit_string )
224  (*ppachData)[1] = '5';
226  (*ppachData)[1] = '6';
227 
228  (*ppachData)[2] = '0';
229  (*ppachData)[3] = '0';
230  (*ppachData)[4] = ';';
231  (*ppachData)[5] = '&';
232  (*ppachData)[6] = ' ';
233  (*ppachData)[7] = ' ';
234  (*ppachData)[8] = ' ';
235  sprintf( *ppachData + 9, "%s%c%s",
237 
238  if( strlen(_formatControls) > 0 )
239  sprintf( *ppachData + strlen(*ppachData), "%c%s",
241  sprintf( *ppachData + strlen(*ppachData), "%c", OSSIM_DDF_FIELD_TERMINATOR );
242 
243  return true;
244 }
245 
246 /************************************************************************/
247 /* Initialize() */
248 /* */
249 /* Initialize the field definition from the information in the */
250 /* DDR record. This is called by DDFModule::Open(). */
251 /************************************************************************/
252 
254  const char * pszTagIn,
255  int nFieldEntrySize,
256  const char * pachFieldArea )
257 
258 {
259  int iFDOffset = poModuleIn->GetFieldControlLength();
260  int nCharsConsumed;
261 
262  poModule = poModuleIn;
263 
264  pszTag = strdup( pszTagIn );
265 
266 /* -------------------------------------------------------------------- */
267 /* Set the data struct and type codes. */
268 /* -------------------------------------------------------------------- */
269  switch( pachFieldArea[0] )
270  {
271  case '0':
273  break;
274 
275  case '1':
277  break;
278 
279  case '2':
281  break;
282 
283  case '3':
285  break;
286 
287  default:
288  if (traceDebug())
289  {
291  << "Unrecognised data_struct_code value %c.\n"
292  << "Field %s initialization incorrect.\n"
293  << pachFieldArea[0]
294  << pszTag
295  << std::endl;
296  }
298  }
299 
300  switch( pachFieldArea[1] )
301  {
302  case '0':
304  break;
305 
306  case '1':
308  break;
309 
310  case '2':
312  break;
313 
314  case '3':
316  break;
317 
318  case '4':
320  break;
321 
322  case '5':
324  break;
325 
326  case '6':
328  break;
329 
330  default:
331  if (traceDebug())
332  {
334  << "Unrecognised data_type_code value %c.\n"
335  << "Field %s initialization incorrect.\n"
336  << pachFieldArea[1] << pszTag << std::endl;
337  }
339  }
340 
341 /* -------------------------------------------------------------------- */
342 /* Capture the field name, description (sub field names), and */
343 /* format statements. */
344 /* -------------------------------------------------------------------- */
345 
346  _fieldName =
347  ossimDDFFetchVariable( pachFieldArea + iFDOffset,
348  nFieldEntrySize - iFDOffset,
351  &nCharsConsumed );
352  iFDOffset += nCharsConsumed;
353 
354  _arrayDescr =
355  ossimDDFFetchVariable( pachFieldArea + iFDOffset,
356  nFieldEntrySize - iFDOffset,
359  &nCharsConsumed );
360  iFDOffset += nCharsConsumed;
361 
363  ossimDDFFetchVariable( pachFieldArea + iFDOffset,
364  nFieldEntrySize - iFDOffset,
367  &nCharsConsumed );
368 
369 /* -------------------------------------------------------------------- */
370 /* Parse the subfield info. */
371 /* -------------------------------------------------------------------- */
373  {
374  if( !BuildSubfields() )
375  return false;
376 
377  if( !ApplyFormats() )
378  return false;
379  }
380 
381  return true;
382 }
383 
384 /************************************************************************/
385 /* Dump() */
386 /************************************************************************/
387 
397 void ossimDDFFieldDefn::Dump( FILE * fp )
398 
399 {
400  const char *pszValue = "";
401 
402  fprintf( fp, " DDFFieldDefn:\n" );
403  fprintf( fp, " Tag = `%s'\n", pszTag );
404  fprintf( fp, " _fieldName = `%s'\n", _fieldName );
405  fprintf( fp, " _arrayDescr = `%s'\n", _arrayDescr );
406  fprintf( fp, " _formatControls = `%s'\n", _formatControls );
407 
408  switch( _data_struct_code )
409  {
410  case dsc_elementary:
411  pszValue = "elementary";
412  break;
413 
414  case dsc_vector:
415  pszValue = "vector";
416  break;
417 
418  case dsc_array:
419  pszValue = "array";
420  break;
421 
422  case dsc_concatenated:
423  pszValue = "concatenated";
424  break;
425 
426  default:
427  // assert( false );
428  pszValue = "(unknown)";
429  }
430 
431  fprintf( fp, " _data_struct_code = %s\n", pszValue );
432 
433  switch( _data_type_code )
434  {
435  case dtc_char_string:
436  pszValue = "char_string";
437  break;
438 
439  case dtc_implicit_point:
440  pszValue = "implicit_point";
441  break;
442 
443  case dtc_explicit_point:
444  pszValue = "explicit_point";
445  break;
446 
448  pszValue = "explicit_point_scaled";
449  break;
450 
451  case dtc_char_bit_string:
452  pszValue = "char_bit_string";
453  break;
454 
455  case dtc_bit_string:
456  pszValue = "bit_string";
457  break;
458 
459  case dtc_mixed_data_type:
460  pszValue = "mixed_data_type";
461  break;
462 
463  default:
464  // assert( false );
465  pszValue = "(unknown)";
466  break;
467  }
468 
469  fprintf( fp, " _data_type_code = %s\n", pszValue );
470 
471  for( int i = 0; i < nSubfieldCount; i++ )
472  papoSubfields[i]->Dump( fp );
473 }
474 
475 /************************************************************************/
476 /* BuildSubfields() */
477 /* */
478 /* Based on the _arrayDescr build a set of subfields. */
479 /************************************************************************/
480 
482 
483 {
484  char **papszSubfieldNames;
485  const char *pszSublist = _arrayDescr;
486 
487  if( pszSublist[0] == '*' )
488  {
489  bRepeatingSubfields = true;
490  pszSublist++;
491  }
492 
493  papszSubfieldNames = ossimCSLTokenizeStringComplex( pszSublist, "!",
494  false, false );
495 
496  int nSFCount = ossimCSLCount( papszSubfieldNames );
497  for( int iSF = 0; iSF < nSFCount; iSF++ )
498  {
500 
501  poSFDefn->SetName( papszSubfieldNames[iSF] );
502  AddSubfield( poSFDefn, true );
503  }
504 
505  ossimCSLDestroy( papszSubfieldNames );
506 
507  return true;
508 }
509 
510 /************************************************************************/
511 /* ExtractSubstring() */
512 /* */
513 /* Extract a substring terminated by a comma (or end of */
514 /* string). Commas in brackets are ignored as terminated with */
515 /* bracket nesting understood gracefully. If the returned */
516 /* string would being and end with a bracket then strip off the */
517 /* brackets. */
518 /* */
519 /* Given a string like "(A,3(B,C),D),X,Y)" return "A,3(B,C),D". */
520 /* Give a string like "3A,2C" return "3A". */
521 /************************************************************************/
522 
523 char *ossimDDFFieldDefn::ExtractSubstring( const char * pszSrc )
524 
525 {
526  int nBracket=0, i;
527  char *pszReturn;
528 
529  for( i = 0;
530  pszSrc[i] != '\0' && (nBracket > 0 || pszSrc[i] != ',');
531  i++ )
532  {
533  if( pszSrc[i] == '(' )
534  nBracket++;
535  else if( pszSrc[i] == ')' )
536  nBracket--;
537  }
538 
539  if( pszSrc[0] == '(' )
540  {
541  pszReturn = strdup( pszSrc + 1 );
542  pszReturn[i-2] = '\0';
543  }
544  else
545  {
546  pszReturn = strdup( pszSrc );
547  pszReturn[i] = '\0';
548  }
549 
550  return pszReturn;
551 }
552 
553 /************************************************************************/
554 /* ExpandFormat() */
555 /************************************************************************/
556 
557 char *ossimDDFFieldDefn::ExpandFormat( const char * pszSrc )
558 
559 {
560  int nDestMax = 32;
561  char *pszDest = (char *) malloc(nDestMax+1);
562  int iSrc, iDst;
563  int nRepeat = 0;
564 
565  iSrc = 0;
566  iDst = 0;
567  pszDest[0] = '\0';
568 
569  while( pszSrc[iSrc] != '\0' )
570  {
571  /* This is presumably an extra level of brackets around some
572  binary stuff related to rescaning which we don't care to do
573  (see 6.4.3.3 of the standard. We just strip off the extra
574  layer of brackets */
575  if( (iSrc == 0 || pszSrc[iSrc-1] == ',') && pszSrc[iSrc] == '(' )
576  {
577  char *pszContents = ExtractSubstring( pszSrc+iSrc );
578  char *pszExpandedContents = ExpandFormat( pszContents );
579 
580  if( (int) (strlen(pszExpandedContents) + strlen(pszDest) + 1)
581  > nDestMax )
582  {
583  nDestMax = 2 * ((int)strlen(pszExpandedContents) + (int)strlen(pszDest));
584  pszDest = (char *) realloc(pszDest,nDestMax+1);
585  }
586 
587  strcat( pszDest, pszExpandedContents );
588  iDst = (int)strlen(pszDest);
589 
590  iSrc = iSrc + (int)strlen(pszContents) + 2;
591 
592  free( pszContents );
593  free( pszExpandedContents );
594  }
595 
596  /* this is a repeated subclause */
597  else if( (iSrc == 0 || pszSrc[iSrc-1] == ',')
598  && isdigit(pszSrc[iSrc]) )
599  {
600  const char *pszNext;
601  nRepeat = atoi(pszSrc+iSrc);
602 
603  // skip over repeat count.
604  for( pszNext = pszSrc+iSrc; isdigit(*pszNext); pszNext++ )
605  iSrc++;
606 
607  char *pszContents = ExtractSubstring( pszNext );
608  char *pszExpandedContents = ExpandFormat( pszContents );
609 
610  for( int i = 0; i < nRepeat; i++ )
611  {
612  if( (int) (strlen(pszExpandedContents) + strlen(pszDest) + 1)
613  > nDestMax )
614  {
615  nDestMax =
616  2 * ((int)strlen(pszExpandedContents) + (int)strlen(pszDest));
617  pszDest = (char *) realloc(pszDest,nDestMax+1);
618  }
619 
620  strcat( pszDest, pszExpandedContents );
621  if( i < nRepeat-1 )
622  strcat( pszDest, "," );
623  }
624 
625  iDst = (int)strlen(pszDest);
626 
627  if( pszNext[0] == '(' )
628  iSrc = iSrc + (int)strlen(pszContents) + 2;
629  else
630  iSrc = iSrc + (int)strlen(pszContents);
631 
632  free( pszContents );
633  free( pszExpandedContents );
634  }
635  else
636  {
637  if( iDst+1 >= nDestMax )
638  {
639  nDestMax = 2 * iDst;
640  pszDest = (char *) realloc(pszDest,nDestMax);
641  }
642 
643  pszDest[iDst++] = pszSrc[iSrc++];
644  pszDest[iDst] = '\0';
645  }
646  }
647 
648  return pszDest;
649 }
650 
651 /************************************************************************/
652 /* ApplyFormats() */
653 /* */
654 /* This method parses the format string partially, and then */
655 /* applies a subfield format string to each subfield object. */
656 /* It in turn does final parsing of the subfield formats. */
657 /************************************************************************/
658 
660 
661 {
662  char *pszFormatList;
663  char **papszFormatItems;
664 
665 /* -------------------------------------------------------------------- */
666 /* Verify that the format string is contained within brackets. */
667 /* -------------------------------------------------------------------- */
668  if( strlen(_formatControls) < 2
669  || _formatControls[0] != '('
670  || _formatControls[strlen(_formatControls)-1] != ')' )
671  {
673  << "Format controls for `%s' field missing brackets:%s\n"
674  << pszTag << _formatControls << std::endl;
675 
676  return false;
677  }
678 
679 /* -------------------------------------------------------------------- */
680 /* Duplicate the string, and strip off the brackets. */
681 /* -------------------------------------------------------------------- */
682 
683  pszFormatList = ExpandFormat( _formatControls );
684 
685 /* -------------------------------------------------------------------- */
686 /* Tokenize based on commas. */
687 /* -------------------------------------------------------------------- */
688  papszFormatItems =
689  ossimCSLTokenizeStringComplex(pszFormatList, ",", false, false );
690 
691  free( pszFormatList );
692 
693 /* -------------------------------------------------------------------- */
694 /* Apply the format items to subfields. */
695 /* -------------------------------------------------------------------- */
696  int iFormatItem;
697 
698  for( iFormatItem = 0;
699  papszFormatItems[iFormatItem] != NULL;
700  iFormatItem++ )
701  {
702  const char *pszPastPrefix;
703 
704  pszPastPrefix = papszFormatItems[iFormatItem];
705  while( *pszPastPrefix >= '0' && *pszPastPrefix <= '9' )
706  pszPastPrefix++;
707 
709  // Did we get too many formats for the subfields created
710  // by names? This may be legal by the 8211 specification, but
711  // isn't encountered in any formats we care about so we just
712  // blow.
713 
714  if( iFormatItem >= nSubfieldCount )
715  {
717  << "Got more formats than subfields for field `%s'.\n"
718  << pszTag << std::endl;
719  break;
720  }
721 
722  if( !papoSubfields[iFormatItem]->SetFormat(pszPastPrefix) )
723  return false;
724  }
725 
726 /* -------------------------------------------------------------------- */
727 /* Verify that we got enough formats, cleanup and return. */
728 /* -------------------------------------------------------------------- */
729  ossimCSLDestroy( papszFormatItems );
730 
731  if( iFormatItem < nSubfieldCount )
732  {
734  << "Got less formats than subfields for field `%s',\n"
735  << pszTag << std::endl;
736  return false;
737  }
738 
739 /* -------------------------------------------------------------------- */
740 /* If all the fields are fixed width, then we are fixed width */
741 /* too. This is important for repeating fields. */
742 /* -------------------------------------------------------------------- */
743  nFixedWidth = 0;
744  for( int i = 0; i < nSubfieldCount; i++ )
745  {
746  if( papoSubfields[i]->GetWidth() == 0 )
747  {
748  nFixedWidth = 0;
749  break;
750  }
751  else
753  }
754 
755  return true;
756 }
757 
758 /************************************************************************/
759 /* FindSubfieldDefn() */
760 /************************************************************************/
761 
772 
773 {
774  for( int i = 0; i < nSubfieldCount; i++ )
775  {
777  if( s == pszMnemonic )
778  return papoSubfields[i];
779  }
780 
781  return NULL;
782 }
783 
784 /************************************************************************/
785 /* GetSubfield() */
786 /* */
787 /* Fetch a subfield by it's index. */
788 /************************************************************************/
789 
799 
800 {
801  if( i < 0 || i >= nSubfieldCount )
802  {
803  // assert( false );
804  return NULL;
805  }
806 
807  return papoSubfields[i];
808 }
809 
810 /************************************************************************/
811 /* GetDefaultValue() */
812 /************************************************************************/
813 
819 
820 {
821 /* -------------------------------------------------------------------- */
822 /* Loop once collecting the sum of the subfield lengths. */
823 /* -------------------------------------------------------------------- */
824  int iSubfield;
825  int nTotalSize = 0;
826 
827  for( iSubfield = 0; iSubfield < nSubfieldCount; iSubfield++ )
828  {
829  int nSubfieldSize;
830 
831  if( !papoSubfields[iSubfield]->GetDefaultValue( NULL, 0,
832  &nSubfieldSize ) )
833  return NULL;
834  nTotalSize += nSubfieldSize;
835  }
836 
837 /* -------------------------------------------------------------------- */
838 /* Allocate buffer. */
839 /* -------------------------------------------------------------------- */
840  char *pachData = (char *) malloc( nTotalSize );
841 
842  if( pnSize != NULL )
843  *pnSize = nTotalSize;
844 
845 /* -------------------------------------------------------------------- */
846 /* Loop again, collecting actual default values. */
847 /* -------------------------------------------------------------------- */
848  int nOffset = 0;
849  for( iSubfield = 0; iSubfield < nSubfieldCount; iSubfield++ )
850  {
851  int nSubfieldSize;
852 
853  if( !papoSubfields[iSubfield]->GetDefaultValue(
854  pachData + nOffset, nTotalSize - nOffset, &nSubfieldSize ) )
855  {
856  // assert( false );
857  free( pachData );
858  return NULL;
859  }
860 
861  nOffset += nSubfieldSize;
862  }
863 
864  // assert( nOffset == nTotalSize );
865 
866  return pachData;
867 }
const char * GetName()
Get pointer to subfield name.
Definition: ossimIso8211.h:288
static char * ExtractSubstring(const char *)
char * GetDefaultValue(int *pnSize)
Return default data for field instance.
ossimDDFModule * poModule
Definition: ossimIso8211.h:243
int Initialize(ossimDDFModule *poModule, const char *pszTag, int nSize, const char *pachRecord)
char * ossimDDFFetchVariable(const char *pszString, int nMaxChars, int nDelimChar1, int nDelimChar2, int *pnConsumedChars)
ossimDDFSubfieldDefn ** papoSubfields
Definition: ossimIso8211.h:261
OSSIMDLLEXPORT int ossimCSLCount(char **papszStrList)
int GetFieldControlLength()
Definition: ossimIso8211.h:122
static char * ExpandFormat(const char *)
int GenerateDDREntry(char **ppachData, int *pnLength)
OSSIMDLLEXPORT void ossimCSLDestroy(char **papszStrList)
void AddSubfield(ossimDDFSubfieldDefn *poNewSFDefn, int bDontAddToFormat=false)
void Dump(FILE *fp)
Write out field definition info to debugging file.
ossimDDFSubfieldDefn * FindSubfieldDefn(const char *)
Find a subfield definition by it&#39;s mnemonic tag.
void SetName(const char *pszName)
DDF_data_type_code
Definition: ossimIso8211.h:164
DDF_data_type_code _data_type_code
Definition: ossimIso8211.h:258
DDF_data_struct_code _data_struct_code
Definition: ossimIso8211.h:256
The primary class for reading ISO 8211 files.
Definition: ossimIso8211.h:88
OSSIMDLLEXPORT char ** ossimCSLTokenizeStringComplex(const char *pszString, const char *pszDelimiter, int bHonourStrings, int bAllowEmptyTokens)
#define OSSIM_DDF_UNIT_TERMINATOR
Definition: ossimIso8211.h:65
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).
Definition: ossimIso8211.h:324
const char * GetFormat()
Get pointer to subfield format string.
Definition: ossimIso8211.h:291
DDF_data_struct_code
Definition: ossimIso8211.h:163
int SetFormat(const char *pszFormat)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimDDFSubfieldDefn * GetSubfield(int i)
Fetch a subfield by index.
Information from the DDR record describing one subfield of a DDFFieldDefn.
Definition: ossimIso8211.h:278
#define OSSIM_DDF_FIELD_TERMINATOR
Definition: ossimIso8211.h:62