OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDdfsubfielddefn.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 DDFSubfieldDefn class.
6  * Author: Frank Warmerdam, warmerda@home.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: ossimDdfsubfielddefn.cpp 23245 2015-04-08 20:53:04Z rashadkm $
30  */
31 
32 #include <cstring>
35 #include <ossim/base/ossimCommon.h>
36 
37 /************************************************************************/
38 /* DDFSubfieldDefn() */
39 /************************************************************************/
40 
42 
43 {
44  pszName = NULL;
45 
46  bIsVariable = true;
47  nFormatWidth = 0;
50  eType = DDFString;
51 
52  pszFormatString = strdup("");
53 
54  nMaxBufChars = 0;
55  pachBuffer = NULL;
56 }
57 
58 /************************************************************************/
59 /* ~DDFSubfieldDefn() */
60 /************************************************************************/
61 
63 
64 {
65  free( pszName );
66  free( pszFormatString );
67  free( pachBuffer );
68 }
69 
70 /************************************************************************/
71 /* SetName() */
72 /************************************************************************/
73 
74 void ossimDDFSubfieldDefn::SetName( const char * pszNewName )
75 
76 {
77  int i;
78 
79  free( pszName );
80 
81  pszName = strdup( pszNewName );
82 
83  for( i = (int)strlen(pszName)-1; i > 0 && pszName[i] == ' '; i-- )
84  pszName[i] = '\0';
85 }
86 
87 /************************************************************************/
88 /* SetFormat() */
89 /* */
90 /* While interpreting the format string we don't support: */
91 /* */
92 /* o Passing an explicit terminator for variable length field. */
93 /* o 'X' for unused data ... this should really be filtered */
94 /* out by DDFFieldDefn::ApplyFormats(), but isn't. */
95 /* o 'B' bitstrings that aren't a multiple of eight. */
96 /************************************************************************/
97 
98 int ossimDDFSubfieldDefn::SetFormat( const char * pszFormat )
99 
100 {
101  free( pszFormatString );
102  pszFormatString = strdup( pszFormat );
103 
104 /* -------------------------------------------------------------------- */
105 /* These values will likely be used. */
106 /* -------------------------------------------------------------------- */
107  if( pszFormatString[1] == '(' )
108  {
109  nFormatWidth = atoi(pszFormatString+2);
110  bIsVariable = nFormatWidth == 0;
111  }
112  else
113  bIsVariable = true;
114 
115 /* -------------------------------------------------------------------- */
116 /* Interpret the format string. */
117 /* -------------------------------------------------------------------- */
118  switch( pszFormatString[0] )
119  {
120  case 'A':
121  case 'C': // It isn't clear to me how this is different than 'A'
122  eType = DDFString;
123  break;
124 
125  case 'R':
126  eType = DDFFloat;
127  break;
128 
129  case 'I':
130  case 'S':
131  eType = DDFInt;
132  break;
133 
134  case 'B':
135  case 'b':
136  // Is the width expressed in bits? (is it a bitstring)
137  bIsVariable = false;
138  if( pszFormatString[1] == '(' )
139  {
140  // CPLAssert( atoi(pszFormatString+2) % 8 == 0 );
141 
142  nFormatWidth = atoi(pszFormatString+2) / 8;
143  eBinaryFormat = SInt; // good default, works for SDTS.
144 
145  if( nFormatWidth < 5 )
146  eType = DDFInt;
147  else
149  }
150 
151  // or do we have a binary type indicator? (is it binary)
152  else
153  {
155  nFormatWidth = atoi(pszFormatString+2);
156 
157  if( eBinaryFormat == SInt || eBinaryFormat == UInt )
158  eType = DDFInt;
159  else
160  eType = DDFFloat;
161  }
162  break;
163 
164  case 'X':
165  // 'X' is extra space, and shouldn't be directly assigned to a
166  // subfield ... I haven't encountered it in use yet though.
168  << "Format type of `%c' not supported.\n"
169  << pszFormatString[0] << std::endl;
170 
171  // CPLAssert( false );
172  return false;
173 
174  default:
176  << "Format type of `%c' not recognised.\n"
177  << pszFormatString[0] << std::endl;
178 
179  // CPLAssert( false );
180  return false;
181  }
182 
183  return true;
184 }
185 
186 /************************************************************************/
187 /* Dump() */
188 /************************************************************************/
189 
199 void ossimDDFSubfieldDefn::Dump( FILE * fp )
200 
201 {
202  fprintf( fp, " DDFSubfieldDefn:\n" );
203  fprintf( fp, " Label = `%s'\n", pszName );
204  fprintf( fp, " FormatString = `%s'\n", pszFormatString );
205 }
206 
207 /************************************************************************/
208 /* GetDataLength() */
209 /* */
210 /* This method will scan for the end of a variable field. */
211 /************************************************************************/
212 
237 int ossimDDFSubfieldDefn::GetDataLength( const char * pachSourceData,
238  int nMaxBytes, int * pnConsumedBytes )
239 
240 {
241  if( !bIsVariable )
242  {
243  if( nFormatWidth > nMaxBytes )
244  {
246  << "Only %d bytes available for subfield %s with\n"
247  << "format string %s ... returning shortened data."
248  << nMaxBytes << pszName << pszFormatString << std::endl;
249 
250  if( pnConsumedBytes != NULL )
251  *pnConsumedBytes = nMaxBytes;
252 
253  return nMaxBytes;
254  }
255  else
256  {
257  if( pnConsumedBytes != NULL )
258  *pnConsumedBytes = nFormatWidth;
259 
260  return nFormatWidth;
261  }
262  }
263  else
264  {
265  int nLength = 0;
266  int bCheckFieldTerminator = true;
267 
268  /* We only check for the field terminator because of some buggy
269  * datasets with missing format terminators. However, we have found
270  * the field terminator is a legal character within the fields of
271  * some extended datasets (such as JP34NC94.000). So we don't check
272  * for the field terminator if the field appears to be multi-byte
273  * which we established by the first character being out of the
274  * ASCII printable range (32-127).
275  */
276 
277  if( pachSourceData[0] < 32 || pachSourceData[0] >= 127 )
278  bCheckFieldTerminator = false;
279 
280  while( nLength < nMaxBytes
281  && pachSourceData[nLength] != chFormatDelimeter )
282  {
283  if( bCheckFieldTerminator
284  && pachSourceData[nLength] == OSSIM_DDF_FIELD_TERMINATOR )
285  break;
286 
287  nLength++;
288  }
289 
290  if( pnConsumedBytes != NULL )
291  {
292  if( nMaxBytes == 0 )
293  *pnConsumedBytes = nLength;
294  else
295  *pnConsumedBytes = nLength+1;
296  }
297 
298  return nLength;
299  }
300 }
301 
302 /************************************************************************/
303 /* ExtractStringData() */
304 /************************************************************************/
305 
337 const char *
338 ossimDDFSubfieldDefn::ExtractStringData( const char * pachSourceData,
339  int nMaxBytes, int * pnConsumedBytes )
340 
341 {
342  int nLength = GetDataLength( pachSourceData, nMaxBytes,
343  pnConsumedBytes );
344 
345 /* -------------------------------------------------------------------- */
346 /* Do we need to grow the buffer. */
347 /* -------------------------------------------------------------------- */
348  if( nMaxBufChars < nLength+1 )
349  {
350  free( pachBuffer );
351 
352  nMaxBufChars = nLength+1;
353  pachBuffer = (char *) malloc(nMaxBufChars);
354  }
355 
356 /* -------------------------------------------------------------------- */
357 /* Copy the data to the buffer. We use memcpy() so that it */
358 /* will work for binary data. */
359 /* -------------------------------------------------------------------- */
360  memcpy( pachBuffer, pachSourceData, nLength );
361  pachBuffer[nLength] = '\0';
362 
363  return pachBuffer;
364 }
365 
366 /************************************************************************/
367 /* ExtractFloatData() */
368 /************************************************************************/
369 
393 double
394 ossimDDFSubfieldDefn::ExtractFloatData( const char * pachSourceData,
395  int nMaxBytes, int * pnConsumedBytes )
396 
397 {
398  switch( pszFormatString[0] )
399  {
400  case 'A':
401  case 'I':
402  case 'R':
403  case 'S':
404  case 'C':
405  return atof(ExtractStringData(pachSourceData, nMaxBytes,
406  pnConsumedBytes));
407 
408  case 'B':
409  case 'b':
410  {
411  unsigned char abyData[8];
412 
413  // CPLAssert( nFormatWidth <= nMaxBytes );
414  if( pnConsumedBytes != NULL )
415  *pnConsumedBytes = nFormatWidth;
416 
417  // Byte swap the data if it isn't in machine native format.
418  // In any event we copy it into our buffer to ensure it is
419  // word aligned.
420 #ifdef CPL_LSB
421  if( pszFormatString[0] == 'B' )
422 #else
423  if( pszFormatString[0] == 'b' )
424 #endif
425  {
426  for( int i = 0; i < nFormatWidth; i++ )
427  abyData[nFormatWidth-i-1] = pachSourceData[i];
428  }
429  else
430  {
431  memcpy( abyData, pachSourceData, nFormatWidth );
432  }
433 
434  // Interpret the bytes of data.
435  switch( eBinaryFormat )
436  {
437  case UInt:
438  if( nFormatWidth == 1 )
439  {
440  return( abyData[0] );
441  }
442  else if( nFormatWidth == 2 )
443  {
444  ossim_uint16* ptr = (ossim_uint16*) abyData;
445  return *ptr;
446  }
447  else if( nFormatWidth == 4 )
448  {
449  ossim_uint32* ptr = (ossim_uint32*) abyData;
450  return *ptr;
451  }
452  else
453  {
454  // CPLAssert( false );
455  return 0.0;
456  }
457 
458  case SInt:
459  if( nFormatWidth == 1 )
460  {
461  signed char* ptr = (signed char*) abyData;
462  return *ptr;
463  }
464  else if( nFormatWidth == 2 )
465  {
466  ossim_int16* ptr = (ossim_int16*) abyData;
467  return *ptr;
468  }
469  else if( nFormatWidth == 4 )
470  {
471  ossim_int32* ptr = (ossim_int32*) abyData;
472  return *ptr;
473  }
474  else
475  {
476  // CPLAssert( false );
477  return 0.0;
478  }
479 
480  case FloatReal:
481  if( nFormatWidth == 4 )
482  {
483  float* ptr = (float*) abyData;
484  return *ptr;
485  }
486  else if( nFormatWidth == 8 )
487  {
488  double* ptr = (double*) abyData;
489  return *ptr;
490  }
491  else
492  {
493  // CPLAssert( false );
494  return 0.0;
495  }
496 
497  case NotBinary:
498  case FPReal:
499  case FloatComplex:
500  // CPLAssert( false );
501  return 0.0;
502  }
503  break;
504  // end of 'b'/'B' case.
505  }
506 
507  default:
508  // CPLAssert( false );
509  return 0.0;
510  }
511 
512  // CPLAssert( false );
513  return 0.0;
514 }
515 
516 /************************************************************************/
517 /* ExtractIntData() */
518 /************************************************************************/
519 
543 int
544 ossimDDFSubfieldDefn::ExtractIntData( const char * pachSourceData,
545  int nMaxBytes, int * pnConsumedBytes )
546 
547 {
548  switch( pszFormatString[0] )
549  {
550  case 'A':
551  case 'I':
552  case 'R':
553  case 'S':
554  case 'C':
555  return atoi(ExtractStringData(pachSourceData, nMaxBytes,
556  pnConsumedBytes));
557 
558  case 'B':
559  case 'b':
560  {
561  unsigned char abyData[8];
562 
563  if( nFormatWidth > nMaxBytes )
564  {
566  << "Attempt to extract int subfield %s with format %s\n"
567  << "failed as only %d bytes available. Using zero."
568  << pszName << pszFormatString << nMaxBytes << std::endl;
569  return 0;
570  }
571 
572  if( pnConsumedBytes != NULL )
573  *pnConsumedBytes = nFormatWidth;
574 
575  // Byte swap the data if it isn't in machine native format.
576  // In any event we copy it into our buffer to ensure it is
577  // word aligned.
578 #ifdef CPL_LSB
579  if( pszFormatString[0] == 'B' )
580 #else
581  if( pszFormatString[0] == 'b' )
582 #endif
583  {
584  for( int i = 0; i < nFormatWidth; i++ )
585  abyData[nFormatWidth-i-1] = pachSourceData[i];
586  }
587  else
588  {
589  memcpy( abyData, pachSourceData, nFormatWidth );
590  }
591 
592  // Interpret the bytes of data.
593  switch( eBinaryFormat )
594  {
595  case UInt:
596  if( nFormatWidth == 4 )
597  {
598  ossim_uint32* ptr = (ossim_uint32*) abyData;
599  return *ptr;
600  }
601  else if( nFormatWidth == 1 )
602  {
603  return( abyData[0] );
604  }
605  else if( nFormatWidth == 2 )
606  {
607  ossim_uint16* ptr = (ossim_uint16*)abyData;
608  return *ptr;
609  }
610  else
611  {
612  // CPLAssert( false );
613  return 0;
614  }
615 
616  case SInt:
617  if( nFormatWidth == 4 )
618  {
619  ossim_int32* ptr = (ossim_int32 *) abyData;
620  return *ptr;
621  }
622  else if( nFormatWidth == 1 )
623  {
624  signed char* ptr = (signed char *) abyData;
625  return *ptr;
626  }
627  else if( nFormatWidth == 2 )
628  {
629  ossim_int16* ptr = (ossim_int16 *) abyData;
630  return *ptr;
631  }
632  else
633  {
634  // CPLAssert( false );
635  return 0;
636  }
637 
638  case FloatReal:
639  if( nFormatWidth == 4 )
640  {
641  float* ptr = (float *) abyData;
642  return (int) *ptr;
643  }
644  else if( nFormatWidth == 8 )
645  {
646  double* ptr = (double *) abyData;
647  return (int) *ptr;
648  }
649  else
650  {
651  // CPLAssert( false );
652  return 0;
653  }
654 
655  case NotBinary:
656  case FPReal:
657  case FloatComplex:
658  // CPLAssert( false );
659  return 0;
660  }
661  break;
662  // end of 'b'/'B' case.
663  }
664 
665  default:
666  // CPLAssert( false );
667  return 0;
668  }
669 
670  // CPLAssert( false );
671  return 0;
672 }
673 
674 /************************************************************************/
675 /* DumpData() */
676 /* */
677 /* Dump the instance data for this subfield from a data */
678 /* record. This fits into the output dump stream of a DDFField. */
679 /************************************************************************/
680 
689 void ossimDDFSubfieldDefn::DumpData( const char * pachData, int nMaxBytes,
690  FILE * fp )
691 
692 {
693  if( eType == DDFFloat )
694  fprintf( fp, " Subfield `%s' = %f\n",
695  pszName,
696  ExtractFloatData( pachData, nMaxBytes, NULL ) );
697  else if( eType == DDFInt )
698  fprintf( fp, " Subfield `%s' = %d\n",
699  pszName,
700  ExtractIntData( pachData, nMaxBytes, NULL ) );
701  else if( eType == DDFBinaryString )
702  {
703  int nBytes, i;
704  ossim_uint8 *pabyBString = (ossim_uint8 *) ExtractStringData( pachData, nMaxBytes, &nBytes );
705 
706  fprintf( fp, " Subfield `%s' = 0x", pszName );
707  for( i = 0; i < std::min(nBytes,24); i++ )
708  fprintf( fp, "%02X", pabyBString[i] );
709 
710  if( nBytes > 24 )
711  fprintf( fp, "%s", "..." );
712 
713  fprintf( fp, "\n" );
714  }
715  else
716  fprintf( fp, " Subfield `%s' = `%s'\n",
717  pszName,
718  ExtractStringData( pachData, nMaxBytes, NULL ) );
719 }
720 
721 /************************************************************************/
722 /* GetDefaultValue() */
723 /************************************************************************/
724 
744 int ossimDDFSubfieldDefn::GetDefaultValue( char *pachData, int nBytesAvailable,
745  int *pnBytesUsed )
746 
747 {
748  int nDefaultSize;
749 
750  if( !bIsVariable )
751  nDefaultSize = nFormatWidth;
752  else
753  nDefaultSize = 1;
754 
755  if( pnBytesUsed != NULL )
756  *pnBytesUsed = nDefaultSize;
757 
758  if( pachData == NULL )
759  return true;
760 
761  if( nBytesAvailable < nDefaultSize )
762  return false;
763 
764  if( bIsVariable )
765  {
766  pachData[0] = OSSIM_DDF_UNIT_TERMINATOR;
767  }
768  else
769  {
770  if( GetBinaryFormat() == NotBinary )
771  {
772  if( GetType() == DDFInt || GetType() == DDFFloat )
773  memset( pachData, 0, nDefaultSize );
774  else
775  memset( pachData, ' ', nDefaultSize );
776  }
777  else
778  memset( pachData, 0, nDefaultSize );
779  }
780 
781  return true;
782 }
783 
784 /************************************************************************/
785 /* FormatStringValue() */
786 /************************************************************************/
787 
795 int ossimDDFSubfieldDefn::FormatStringValue( char *pachData, int nBytesAvailable,
796  int *pnBytesUsed,
797  const char *pszValue,
798  int nValueLength )
799 
800 {
801  int nSize;
802 
803  if( nValueLength == -1 )
804  nValueLength = (int)strlen(pszValue);
805 
806  if( bIsVariable )
807  {
808  nSize = nValueLength + 1;
809  }
810  else
811  {
812  nSize = nFormatWidth;
813  }
814 
815  if( pnBytesUsed != NULL )
816  *pnBytesUsed = nSize;
817 
818  if( pachData == NULL )
819  return true;
820 
821  if( nBytesAvailable < nSize )
822  return false;
823 
824  if( bIsVariable )
825  {
826  strncpy( pachData, pszValue, nSize-1 );
827  pachData[nSize-1] = OSSIM_DDF_UNIT_TERMINATOR;
828  }
829  else
830  {
831  if( GetBinaryFormat() == NotBinary )
832  {
833  memset( pachData, ' ', nSize );
834  memcpy( pachData, pszValue, std::min(nValueLength,nSize) );
835  }
836  else
837  {
838  memset( pachData, 0, nSize );
839  memcpy( pachData, pszValue, std::min(nValueLength,nSize) );
840  }
841  }
842 
843  return true;
844 }
845 
846 /************************************************************************/
847 /* FormatIntValue() */
848 /************************************************************************/
849 
857 int ossimDDFSubfieldDefn::FormatIntValue( char *pachData, int nBytesAvailable,
858  int *pnBytesUsed, int nNewValue )
859 
860 {
861  int nSize;
862  char szWork[30];
863 
864  sprintf( szWork, "%d", nNewValue );
865 
866  if( bIsVariable )
867  {
868  nSize = (int)strlen(szWork) + 1;
869  }
870  else
871  {
872  nSize = nFormatWidth;
873 
874  if( GetBinaryFormat() == NotBinary && (int) strlen(szWork) > nSize )
875  return false;
876  }
877 
878  if( pnBytesUsed != NULL )
879  *pnBytesUsed = nSize;
880 
881  if( pachData == NULL )
882  return true;
883 
884  if( nBytesAvailable < nSize )
885  return false;
886 
887  if( bIsVariable )
888  {
889  strncpy( pachData, szWork, nSize-1 );
890  pachData[nSize-1] = OSSIM_DDF_UNIT_TERMINATOR;
891  }
892  else
893  {
894  ossim_uint32 nMask = 0xff;
895  int i;
896 
897  switch( GetBinaryFormat() )
898  {
899  case NotBinary:
900  memset( pachData, '0', nSize );
901  strncpy( pachData + nSize - strlen(szWork), szWork,
902  strlen(szWork) );
903  break;
904 
905  case UInt:
906  case SInt:
907  for( i = 0; i < nFormatWidth; i++ )
908  {
909  int iOut;
910 
911  // big endian required?
912  if( pszFormatString[0] == 'B' )
913  iOut = nFormatWidth - i - 1;
914  else
915  iOut = i;
916 
917  pachData[iOut] = (nNewValue & nMask) >> (i*8);
918  nMask *= 256;
919  }
920  break;
921 
922  case FloatReal:
923  // CPLAssert( false );
924  break;
925 
926  default:
927  // CPLAssert( false );
928  break;
929  }
930  }
931 
932  return true;
933 }
934 
935 /************************************************************************/
936 /* FormatFloatValue() */
937 /************************************************************************/
938 
946 int ossimDDFSubfieldDefn::FormatFloatValue( char *pachData, int nBytesAvailable,
947  int *pnBytesUsed, double dfNewValue )
948 
949 {
950  int nSize;
951  char szWork[120];
952 
953  sprintf( szWork, "%.16g", dfNewValue );
954 
955  if( bIsVariable )
956  {
957  nSize = (int)strlen(szWork) + 1;
958  }
959  else
960  {
961  nSize = nFormatWidth;
962 
963  if( GetBinaryFormat() == NotBinary && (int) strlen(szWork) > nSize )
964  return false;
965  }
966 
967  if( pnBytesUsed != NULL )
968  *pnBytesUsed = nSize;
969 
970  if( pachData == NULL )
971  return true;
972 
973  if( nBytesAvailable < nSize )
974  return false;
975 
976  if( bIsVariable )
977  {
978  strncpy( pachData, szWork, nSize-1 );
979  pachData[nSize-1] = OSSIM_DDF_UNIT_TERMINATOR;
980  }
981  else
982  {
983  if( GetBinaryFormat() == NotBinary )
984  {
985  memset( pachData, '0', nSize );
986  strncpy( pachData + nSize - strlen(szWork), szWork,
987  strlen(szWork) );
988  }
989  else
990  {
991  // CPLAssert( false );
992  /* implement me */
993  }
994  }
995 
996  return true;
997 }
int GetDefaultValue(char *pachData, int nBytesAvailable, int *pnBytesUsed)
Get default data.
const char * ExtractStringData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a zero terminated string containing the data for this subfield.
int FormatFloatValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, double dfNewValue)
Format float subfield value.
double ExtractFloatData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a subfield value as a float.
int FormatStringValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, const char *pszValue, int nValueLength=-1)
Format string subfield value.
void Dump(FILE *fp)
Write out subfield definition info to debugging file.
unsigned short ossim_uint16
int FormatIntValue(char *pachData, int nBytesAvailable, int *pnBytesUsed, int nNewValue)
Format int subfield value.
unsigned int ossim_uint32
void SetName(const char *pszName)
int ExtractIntData(const char *pachData, int nMaxBytes, int *pnConsumedBytes)
Extract a subfield value as an integer.
short ossim_int16
int GetDataLength(const char *, int, int *)
Scan for the end of variable length data.
DDFBinaryFormat eBinaryFormat
Definition: ossimIso8211.h:353
#define OSSIM_DDF_UNIT_TERMINATOR
Definition: ossimIso8211.h:65
DDFBinaryFormat
Binary format: this is the digit immediately following the B or b for binary formats.
Definition: ossimIso8211.h:335
void DumpData(const char *pachData, int nMaxBytes, FILE *fp)
Dump subfield value to debugging file.
int SetFormat(const char *pszFormat)
DDFBinaryFormat GetBinaryFormat(void) const
Definition: ossimIso8211.h:344
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
DDFDataType GetType()
Get the general type of the subfield.
Definition: ossimIso8211.h:302
#define OSSIM_DDF_FIELD_TERMINATOR
Definition: ossimIso8211.h:62
#define min(a, b)
Definition: auxiliary.h:75
int ossim_int32