OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Attributes | List of all members
ossimRpfHeader Class Reference

#include <ossimRpfHeader.h>

Inheritance diagram for ossimRpfHeader:
ossimNitfRegisteredTag ossimObject ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimRpfHeader ()
 default constructor More...
 
 ossimRpfHeader (const ossimRpfHeader &obj)
 copy constructor More...
 
const ossimRpfHeaderoperator= (const ossimRpfHeader &rhs)
 assignment operator More...
 
virtual ~ossimRpfHeader ()
 
virtual void parseStream (std::istream &in)
 Parse method. More...
 
virtual void writeStream (std::ostream &out)
 Write method. More...
 
std::ostream & print (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
virtual ossimByteOrder getByteOrder () const
 
const ossimRpfLocationSectiongetLocationSection () const
 
ossimRpfLocationSectiongetLocationSection ()
 
bool hasComponent (ossimRpfComponentId componentId) const
 
ossimString getSecurityClassification () const
 
ossimRpfCoverageSectiongetNewCoverageSection (const ossimFilename &file) const
 
ossimRpfCoverageSectiongetNewCoverageSection (std::istream &in) const
 
ossimRpfColorGrayscaleSubheadergetNewColorGrayscaleSubheader (std::istream &in) const
 
ossimRpfCompressionSectiongetNewCompressionSection (std::istream &in) const
 
ossimRpfCompressionSectionSubheadergetNewCompressionSectionSubheader (std::istream &in) const
 
ossimRpfImageDisplayParameterSubheadergetNewImageDisplayParameterSubheader (std::istream &in) const
 
ossimRpfAttributeSectionSubheadergetNewAttributeSectionSubheader (std::istream &in) const
 
ossimRpfImageDescriptionSubheadergetNewImageDescriptionSubheader (std::istream &in) const
 
ossimRpfMaskSubsectiongetNewMaskSubsection (std::istream &in) const
 
ossimRpfBoundaryRectSectionSubheadergetNewBoundaryRectSectSubheader (std::istream &in) const
 
ossimRpfBoundaryRectTablegetNewBoundaryRectTable (std::istream &in) const
 
ossimRpfFrameFileIndexSectionSubheadergetNewFrameFileIndexSectionSubheader (std::istream &in) const
 
ossimRpfFrameFileIndexSubsectiongetNewFileIndexSubsection (std::istream &in) const
 
ossimRpfColorTableIndexSectionSubheader * getNewColorTableIndexSectionSubheader (std::istream &in) const
 
ossimRpfCompressionSectiongetNewCompressionSection (const ossimFilename &file) const
 
ossimRpfBoundaryRectSectionSubheadergetNewBoundaryRectSectSubheader (const ossimFilename &file) const
 
ossimRpfBoundaryRectTablegetNewBoundaryRectTable (const ossimFilename &file) const
 
ossimRpfFrameFileIndexSectionSubheadergetNewFrameFileIndexSectionSubheader (const ossimFilename &file) const
 
ossimRpfFrameFileIndexSubsectiongetNewFileIndexSubsection (const ossimFilename &file) const
 
ossimRpfColorTableIndexSectionSubheader * getNewColorTableIndexSectionSubheader (const ossimFilename &file) const
 
ossimString getDate () const
 
ossim_uint32 getLocationSectionLocation () const
 returns the byte position of the location section. More...
 
void setFilename (const ossimString &file)
 
void setNewRepUpIndicator (const ossimString &s)
 
void setGovSpecNumber (const ossimString &s)
 
void setGovSpecDate (const ossimString &s)
 
void setSecurityClassification (const ossimString &s)
 
void setCountryCode (const ossimString &s)
 
void setSecurityReleaseMarking (const ossimString &s)
 
void setLocationSectionPos (std::streamoff off)
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
- Public Member Functions inherited from ossimNitfRegisteredTag
 ossimNitfRegisteredTag ()
 default constructor More...
 
 ossimNitfRegisteredTag (const std::string &tagName, ossim_uint32 tagLength)
 Constructor that takes name and size. More...
 
virtual ~ossimNitfRegisteredTag ()
 destructor More...
 
virtual std::string getRegisterTagName () const
 This will return the name of the registered tag for this user defined header. More...
 
virtual const std::string & getTagName () const
 This will return the name of the registered tag for this user defined header. More...
 
virtual void setTagName (const std::string &tagName)
 
virtual ossim_uint32 getSizeInBytes () const
 Returns the length in bytes of the tag from the CEL or REL field. More...
 
virtual ossim_uint32 getTagLength () const
 Returns the length in bytes of the tag from the CEL or REL field. More...
 
virtual void setTagLength (ossim_uint32 length)
 Set the tag length. More...
 
virtual void parseStream (ossim::istream &in)=0
 This will allow the user defined data to parse the stream. More...
 
virtual void writeStream (ossim::ostream &out)=0
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual void getMetadata (ossimKeywordlist &kwl, const char *prefix=0) const
 Default interface to populate keyword list with metadata. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const ossimString &prefix) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 

Private Attributes

ossim_uint8 m_littleBigEndianIndicator
 0x00 = big, 0xff = little More...
 
ossim_uint16 m_headerSectionLength
 
char m_fileName [13]
 
ossim_uint8 m_newRepUpIndicator
 
char m_govSpecNumber [16]
 
char m_govSpecDate [9]
 
char m_securityClassification [2]
 1 byte field that can have the values More...
 
char m_countryCode [3]
 
char m_securityReleaseMarking [3]
 
ossim_uint32 m_locSectionLoc
 
ossimRpfLocationSectionm_locationSection
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimNitfRegisteredTag
std::string m_tagName
 
ossim_uint32 m_tagLength
 

Detailed Description

Definition at line 37 of file ossimRpfHeader.h.

Constructor & Destructor Documentation

◆ ossimRpfHeader() [1/2]

ossimRpfHeader::ossimRpfHeader ( )

default constructor

Definition at line 55 of file ossimRpfHeader.cpp.

References m_countryCode, m_fileName, m_govSpecDate, m_govSpecNumber, m_securityClassification, and m_securityReleaseMarking.

56  :
57  ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
60  m_fileName(),
63  m_govSpecDate(),
65  m_countryCode(),
67  m_locSectionLoc(0),
69 {
70  memset(m_fileName, ' ' , 12);
71  memset(m_govSpecNumber, ' ', 15);
72  memset(m_govSpecDate, ' ', 8);
73  memset(m_securityClassification, ' ', 1);
74  memset(m_countryCode, ' ', 2);
75  memset(m_securityReleaseMarking, ' ', 2);
76 
77  m_fileName[12] = '\0';
78  m_govSpecNumber[15] = '\0';
79  m_govSpecDate[8] = '\0';
80  m_securityClassification[1] = '\0';
81  m_countryCode[2] = '\0';
82  m_securityReleaseMarking[2] = '\0';
83 }
ossimRpfLocationSection * m_locationSection
ossim_uint32 m_locSectionLoc
ossimNitfRegisteredTag()
default constructor
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossim_uint8 m_newRepUpIndicator
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
char m_countryCode[3]
ossim_uint16 m_headerSectionLength

◆ ossimRpfHeader() [2/2]

ossimRpfHeader::ossimRpfHeader ( const ossimRpfHeader obj)

copy constructor

Definition at line 85 of file ossimRpfHeader.cpp.

References m_countryCode, m_fileName, m_govSpecDate, m_govSpecNumber, m_securityClassification, and m_securityReleaseMarking.

86  :
87  ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
90  m_fileName(),
93  m_govSpecDate(),
95  m_countryCode(),
99 {
100  memcpy(m_fileName, obj.m_fileName, 13);
101  memcpy(m_govSpecNumber, obj.m_govSpecNumber, 16);
102  memcpy(m_govSpecDate, obj.m_govSpecDate, 9);
104  memcpy(m_countryCode, obj.m_countryCode, 3);
106 }
ossimRpfLocationSection * m_locationSection
ossim_uint32 m_locSectionLoc
ossimNitfRegisteredTag()
default constructor
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossim_uint8 m_newRepUpIndicator
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
char m_countryCode[3]
ossim_uint16 m_headerSectionLength

◆ ~ossimRpfHeader()

ossimRpfHeader::~ossimRpfHeader ( )
virtual

Definition at line 128 of file ossimRpfHeader.cpp.

References m_locationSection.

129 {
131  {
132  delete m_locationSection;
133  m_locationSection = 0;
134  }
135 }
ossimRpfLocationSection * m_locationSection

Member Function Documentation

◆ getByteOrder()

ossimByteOrder ossimRpfHeader::getByteOrder ( ) const
virtual

◆ getDate()

ossimString ossimRpfHeader::getDate ( ) const

Definition at line 770 of file ossimRpfHeader.cpp.

References m_govSpecDate.

771 {
772  return m_govSpecDate;
773 }
char m_govSpecDate[9]

◆ getLocationSection() [1/2]

const ossimRpfLocationSection * ossimRpfHeader::getLocationSection ( ) const

◆ getLocationSection() [2/2]

ossimRpfLocationSection * ossimRpfHeader::getLocationSection ( )

Definition at line 275 of file ossimRpfHeader.cpp.

References m_locationSection.

276 {
277  return m_locationSection;
278 }
ossimRpfLocationSection * m_locationSection

◆ getLocationSectionLocation()

ossim_uint32 ossimRpfHeader::getLocationSectionLocation ( ) const

returns the byte position of the location section.

Definition at line 775 of file ossimRpfHeader.cpp.

References m_locSectionLoc.

776 {
777  return m_locSectionLoc;
778 }
ossim_uint32 m_locSectionLoc

◆ getNewAttributeSectionSubheader()

ossimRpfAttributeSectionSubheader * ossimRpfHeader::getNewAttributeSectionSubheader ( std::istream &  in) const

Definition at line 360 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER, and ossimRpfAttributeSectionSubheader::parseStream().

361 {
363 
364  if(in&&m_locationSection)
365  {
367 
369  component))
370  {
372 
373  in.seekg(component.m_componentLocation, ios::beg);
374 
375  if(in)
376  {
377  if(result->parseStream(in, getByteOrder()) !=
379  {
380  delete result;
381  result = 0;
382  }
383  }
384  else
385  {
386  delete result;
387  result = 0;
388  }
389  }
390  }
391 
392  return result;
393 }
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const

◆ getNewBoundaryRectSectSubheader() [1/2]

ossimRpfBoundaryRectSectionSubheader * ossimRpfHeader::getNewBoundaryRectSectSubheader ( std::istream &  in) const

Definition at line 616 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER, and ossimRpfBoundaryRectSectionSubheader::parseStream().

Referenced by getNewBoundaryRectSectSubheader(), and getNewBoundaryRectTable().

617 {
619 
620  if(in&&m_locationSection)
621  {
623 
625  component))
626  {
628 
629  in.seekg(component.m_componentLocation, ios::beg);
630 
631  if(in)
632  {
633  if(result->parseStream(in, getByteOrder()) !=
635  {
636  delete result;
637  result = 0;
638  }
639  }
640  else
641  {
642  delete result;
643  result = 0;
644  }
645  }
646  }
647 
648  return result;
649 
650 }
ossimErrorCode parseStream(std::istream &in, ossimByteOrder)
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const

◆ getNewBoundaryRectSectSubheader() [2/2]

ossimRpfBoundaryRectSectionSubheader * ossimRpfHeader::getNewBoundaryRectSectSubheader ( const ossimFilename file) const

Definition at line 749 of file ossimRpfHeader.cpp.

References ossimString::c_str(), and getNewBoundaryRectSectSubheader().

750 {
751  ifstream in(file.c_str(), ios::in|ios::binary);
752 
754 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimRpfBoundaryRectSectionSubheader * getNewBoundaryRectSectSubheader(std::istream &in) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ getNewBoundaryRectTable() [1/2]

ossimRpfBoundaryRectTable * ossimRpfHeader::getNewBoundaryRectTable ( std::istream &  in) const

Definition at line 573 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), getNewBoundaryRectSectSubheader(), ossimRpfBoundaryRectSectionSubheader::getNumberOfEntries(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_BOUNDARY_RECT_TABLE, ossimRpfBoundaryRectTable::parseStream(), and ossimRpfBoundaryRectTable::setNumberOfEntries().

Referenced by getNewBoundaryRectTable().

574 {
575  ossimRpfBoundaryRectTable* result = 0;
576 
577  if(in&&m_locationSection)
578  {
580 
582 
583  if(tempSubheader)
584  {
586  component))
587  {
588  result = new ossimRpfBoundaryRectTable;
589 
590  result->setNumberOfEntries(tempSubheader->getNumberOfEntries());
591  in.seekg(component.m_componentLocation, ios::beg);
592  if(in)
593  {
594  if(result->parseStream(in, getByteOrder()) !=
596  {
597  delete result;
598  result = 0;
599  }
600  }
601  else
602  {
603  delete result;
604  result = 0;
605  }
606  }
607 
608  delete tempSubheader;
609  tempSubheader = 0;
610  }
611  }
612 
613  return result;
614 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimRpfBoundaryRectSectionSubheader * getNewBoundaryRectSectSubheader(std::istream &in) const
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
virtual ossimByteOrder getByteOrder() const
void setNumberOfEntries(ossim_uint32 numberOfEntries)

◆ getNewBoundaryRectTable() [2/2]

ossimRpfBoundaryRectTable * ossimRpfHeader::getNewBoundaryRectTable ( const ossimFilename file) const

Definition at line 742 of file ossimRpfHeader.cpp.

References ossimString::c_str(), and getNewBoundaryRectTable().

743 {
744  ifstream in(file.c_str(), ios::in|ios::binary);
745 
746  return getNewBoundaryRectTable(in);
747 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimRpfBoundaryRectTable * getNewBoundaryRectTable(std::istream &in) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ getNewColorGrayscaleSubheader()

ossimRpfColorGrayscaleSubheader * ossimRpfHeader::getNewColorGrayscaleSubheader ( std::istream &  in) const

Definition at line 395 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_COLOR_GRAYSCALE_SECTION_SUBHEADER, and ossimRpfColorGrayscaleSubheader::parseStream().

Referenced by ossimRpfFrame::populateColorGrayscaleSection().

396 {
398 
399  if(in&&m_locationSection)
400  {
402 
404  component))
405  {
406  result = new ossimRpfColorGrayscaleSubheader;
407 
408  in.seekg(component.m_componentLocation, ios::beg);
409 
410  if(in)
411  {
412  if(result->parseStream(in, getByteOrder()) !=
414  {
415  delete result;
416  result = 0;
417  }
418  }
419  else
420  {
421  delete result;
422  result = 0;
423  }
424  }
425  }
426 
427  return result;
428 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
virtual ossimByteOrder getByteOrder() const

◆ getNewColorTableIndexSectionSubheader() [1/2]

ossimRpfColorTableIndexSectionSubheader* ossimRpfHeader::getNewColorTableIndexSectionSubheader ( std::istream &  in) const

◆ getNewColorTableIndexSectionSubheader() [2/2]

ossimRpfColorTableIndexSectionSubheader* ossimRpfHeader::getNewColorTableIndexSectionSubheader ( const ossimFilename file) const

◆ getNewCompressionSection() [1/2]

ossimRpfCompressionSection * ossimRpfHeader::getNewCompressionSection ( std::istream &  in) const

Definition at line 430 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER, and ossimRpfCompressionSection::parseStream().

Referenced by getNewCompressionSection(), and ossimRpfFrame::populateCompressionSection().

431 {
432  ossimRpfCompressionSection* result = 0;
433 
434  if(in&&m_locationSection)
435  {
437 
439  component))
440  {
441  result = new ossimRpfCompressionSection;
442 
443  in.seekg(component.m_componentLocation, ios::beg);
444 
445  if(in)
446  {
447  if(result->parseStream(in, getByteOrder()) !=
449  {
450  delete result;
451  result = 0;
452  }
453  }
454  else
455  {
456  delete result;
457  result = 0;
458  }
459  }
460  }
461 
462  return result;
463 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
virtual ossimByteOrder getByteOrder() const

◆ getNewCompressionSection() [2/2]

ossimRpfCompressionSection * ossimRpfHeader::getNewCompressionSection ( const ossimFilename file) const

Definition at line 728 of file ossimRpfHeader.cpp.

References ossimString::c_str(), and getNewCompressionSection().

729 {
730  ifstream in(file.c_str(), ios::in|ios::binary);
731 
732  return getNewCompressionSection(in);
733 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimRpfCompressionSection * getNewCompressionSection(std::istream &in) const

◆ getNewCompressionSectionSubheader()

ossimRpfCompressionSectionSubheader * ossimRpfHeader::getNewCompressionSectionSubheader ( std::istream &  in) const

Definition at line 465 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER, and ossimRpfCompressionSectionSubheader::parseStream().

466 {
468 
469  if(in&&m_locationSection)
470  {
472 
474  component))
475  {
477 
478  in.seekg(component.m_componentLocation, ios::beg);
479 
480  if(in)
481  {
482  if(result->parseStream(in, getByteOrder()) !=
484  {
485  delete result;
486  result = 0;
487  }
488  }
489  else
490  {
491  delete result;
492  result = 0;
493  }
494  }
495  }
496 
497  return result;
498 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
virtual ossimByteOrder getByteOrder() const

◆ getNewCoverageSection() [1/2]

ossimRpfCoverageSection * ossimRpfHeader::getNewCoverageSection ( const ossimFilename file) const

This will return a new coverage section. It will return NULL if one does not exist.

Definition at line 735 of file ossimRpfHeader.cpp.

References ossimString::c_str().

Referenced by ossimRpfFrame::populateCoverageSection().

736 {
737  ifstream in(file.c_str(), ios::in|ios::binary);
738 
739  return getNewCoverageSection(in);
740 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimRpfCoverageSection * getNewCoverageSection(const ossimFilename &file) const

◆ getNewCoverageSection() [2/2]

ossimRpfCoverageSection * ossimRpfHeader::getNewCoverageSection ( std::istream &  in) const

Definition at line 295 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, OSSIM_RPF_COVERAGE_SECTION_SUBHEADER, and ossimRpfCoverageSection::parseStream().

296 {
297  ossimRpfCoverageSection* result = 0;
298 
299  if(in&&m_locationSection)
300  {
302 
304  component))
305  {
306  result = new ossimRpfCoverageSection;
307 
308  in.seekg(component.m_componentLocation, ios::beg);
309 
310  if(in)
311  {
312  result->parseStream(in, getByteOrder());
313  }
314  else
315  {
316  delete result;
317  result = 0;
318  }
319  }
320  }
321  return result;
322 }
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
ossimRpfLocationSection * m_locationSection
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const

◆ getNewFileIndexSubsection() [1/2]

ossimRpfFrameFileIndexSubsection * ossimRpfHeader::getNewFileIndexSubsection ( std::istream &  in) const

Definition at line 686 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), getNewFrameFileIndexSectionSubheader(), ossimRpfFrameFileIndexSectionSubheader::getNumberOfIndexRecords(), ossimRpfFrameFileIndexSectionSubheader::getNumberOfPathnameRecords(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION, ossimRpfFrameFileIndexSubsection::parseStream(), ossimRpfFrameFileIndexSubsection::setNumberOfFileIndexRecords(), and ossimRpfFrameFileIndexSubsection::setNumberOfPathnames().

Referenced by getNewFileIndexSubsection().

687 {
689 
690  if(in&&m_locationSection)
691  {
694 
696  component))
697  {
699 
700  result->setNumberOfFileIndexRecords(tempSubheader->getNumberOfIndexRecords());
701  result->setNumberOfPathnames(tempSubheader->getNumberOfPathnameRecords());
702  in.seekg(component.m_componentLocation, ios::beg);
703  if(in)
704  {
705  if(result->parseStream(in, getByteOrder()) !=
707  {
708  delete result;
709  result = 0;
710  }
711  }
712  else
713  {
714  delete result;
715  result = 0;
716  }
717  }
718  if(tempSubheader)
719  {
720  delete tempSubheader;
721  tempSubheader = 0;
722  }
723  }
724 
725  return result;
726 }
ossimRpfFrameFileIndexSectionSubheader * getNewFrameFileIndexSectionSubheader(std::istream &in) const
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
void setNumberOfFileIndexRecords(ossim_uint32 numberOfIndexRecords)
virtual ossimByteOrder getByteOrder() const
void setNumberOfPathnames(ossim_uint32 numberOfPathnames)

◆ getNewFileIndexSubsection() [2/2]

ossimRpfFrameFileIndexSubsection * ossimRpfHeader::getNewFileIndexSubsection ( const ossimFilename file) const

Definition at line 763 of file ossimRpfHeader.cpp.

References ossimString::c_str(), and getNewFileIndexSubsection().

764 {
765  ifstream in(file.c_str(), ios::in|ios::binary);
766 
767  return getNewFileIndexSubsection(in);
768 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimRpfFrameFileIndexSubsection * getNewFileIndexSubsection(std::istream &in) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ getNewFrameFileIndexSectionSubheader() [1/2]

ossimRpfFrameFileIndexSectionSubheader * ossimRpfHeader::getNewFrameFileIndexSectionSubheader ( std::istream &  in) const

Definition at line 652 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER, and ossimRpfFrameFileIndexSectionSubheader::parseStream().

Referenced by getNewFileIndexSubsection(), and getNewFrameFileIndexSectionSubheader().

653 {
655 
656  if(in&&m_locationSection)
657  {
659 
661  component))
662  {
664 
665  in.seekg(component.m_componentLocation, ios::beg);
666  if(in)
667  {
668  if(result->parseStream(in, getByteOrder()) !=
670  {
671  delete result;
672  result = 0;
673  }
674  }
675  else
676  {
677  delete result;
678  result = 0;
679  }
680  }
681  }
682 
683  return result;
684 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)

◆ getNewFrameFileIndexSectionSubheader() [2/2]

ossimRpfFrameFileIndexSectionSubheader * ossimRpfHeader::getNewFrameFileIndexSectionSubheader ( const ossimFilename file) const

Definition at line 756 of file ossimRpfHeader.cpp.

References ossimString::c_str(), and getNewFrameFileIndexSectionSubheader().

757 {
758  ifstream in(file.c_str(), ios::in|ios::binary);
759 
761 }
ossimRpfFrameFileIndexSectionSubheader * getNewFrameFileIndexSectionSubheader(std::istream &in) const
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ getNewImageDescriptionSubheader()

ossimRpfImageDescriptionSubheader * ossimRpfHeader::getNewImageDescriptionSubheader ( std::istream &  in) const

Definition at line 537 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_IMAGE_DESCRIPTION_SUBHEADER, and ossimRpfImageDescriptionSubheader::parseStream().

Referenced by ossimRpfFrame::populateImageSection().

538 {
540 
541  if(in&&m_locationSection)
542  {
544 
546  component))
547  {
549 
550  in.seekg(component.m_componentLocation, ios::beg);
551 
552  if(in)
553  {
554  if(result->parseStream(in, getByteOrder()) !=
556  {
557  delete result;
558  result = 0;
559  }
560  }
561  else
562  {
563  delete result;
564  result = 0;
565  }
566  }
567  }
568 
569  return result;
570 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)

◆ getNewImageDisplayParameterSubheader()

ossimRpfImageDisplayParameterSubheader * ossimRpfHeader::getNewImageDisplayParameterSubheader ( std::istream &  in) const

Definition at line 502 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_IMAGE_DISPLAY_PARAMETERS_SUBHEADER, and ossimRpfImageDisplayParameterSubheader::parseStream().

Referenced by ossimRpfFrame::populateImageSection().

503 {
505 
506  if(in&&m_locationSection)
507  {
509 
511  component))
512  {
514 
515  in.seekg(component.m_componentLocation, ios::beg);
516 
517  if(in)
518  {
519  if(result->parseStream(in, getByteOrder()) !=
521  {
522  delete result;
523  result = 0;
524  }
525  }
526  else
527  {
528  delete result;
529  result = 0;
530  }
531  }
532  }
533 
534  return result;
535 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
virtual ossimByteOrder getByteOrder() const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)

◆ getNewMaskSubsection()

ossimRpfMaskSubsection * ossimRpfHeader::getNewMaskSubsection ( std::istream &  in) const

Definition at line 324 of file ossimRpfHeader.cpp.

References getByteOrder(), ossimRpfLocationSection::getComponent(), ossimRpfComponentLocationRecord::m_componentLocation, m_locationSection, ossimErrorCodes::OSSIM_OK, OSSIM_RPF_MASK_SUBSECTION, and ossimRpfMaskSubsection::parseStream().

325 {
326  ossimRpfMaskSubsection* result = 0;
327 
328  if(in&&m_locationSection)
329  {
331 
333  component))
334  {
335  result = new ossimRpfMaskSubsection;
336 
337  in.seekg(component.m_componentLocation, ios::beg);
338 
339  if(in)
340  {
341  if(result->parseStream(in, getByteOrder()) !=
343  {
344  delete result;
345  result = 0;
346  }
347  }
348  else
349  {
350  delete result;
351  result = 0;
352  }
353  }
354  }
355 
356  return result;
357 }
ossimRpfLocationSection * m_locationSection
static const ossimErrorCode OSSIM_OK
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
virtual ossimByteOrder getByteOrder() const

◆ getSecurityClassification()

ossimString ossimRpfHeader::getSecurityClassification ( ) const

Definition at line 290 of file ossimRpfHeader.cpp.

References m_securityClassification.

Referenced by ossimCibCadrgTileSource::getSecurityClassification().

291 {
293 }
char m_securityClassification[2]
1 byte field that can have the values

◆ hasComponent()

bool ossimRpfHeader::hasComponent ( ossimRpfComponentId  componentId) const

Definition at line 280 of file ossimRpfHeader.cpp.

References ossimRpfLocationSection::hasComponent(), and m_locationSection.

281 {
283  {
284  return m_locationSection->hasComponent(componentId);
285  }
286 
287  return false;
288 }
ossimRpfLocationSection * m_locationSection
bool hasComponent(ossimRpfComponentId componentId) const

◆ loadState()

bool ossimRpfHeader::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 824 of file ossimRpfHeader.cpp.

References ossimKeywordlist::find().

825 {
826  const char* lookup = 0;
827  ossimString s;
828 
829  lookup = kwl.find(prefix, NEW_REP_UP_INDICATOR_KW);
830  if (lookup)
831  {
832  s = lookup;
834  }
835 
836  lookup = kwl.find(prefix, GOV_SPEC_NUMBER_KW);
837  if (lookup)
838  {
839  s = lookup;
840  setGovSpecNumber(s);
841  }
842 
843  lookup = kwl.find(prefix, GOV_SPEC_DATE_KW);
844  if (lookup)
845  {
846  s = lookup;
847  setGovSpecDate(s);
848  }
849 
850  lookup = kwl.find(prefix, SECURITY_CLASSIFICATION_KW);
851  if (lookup)
852  {
853  s = lookup;
855  }
856 
857  lookup = kwl.find(prefix, COUNTRY_CODE_KW);
858  if (lookup)
859  {
860  s = lookup;
861  setCountryCode(s);
862  }
863 
864  lookup = kwl.find(prefix, SECURITY_RELEASE_MARKING_KW);
865  if (lookup)
866  {
867  s = lookup;
869  }
870 
871  return true;
872 }
void setCountryCode(const ossimString &s)
void setSecurityReleaseMarking(const ossimString &s)
void setNewRepUpIndicator(const ossimString &s)
const char * find(const char *key) const
void setGovSpecDate(const ossimString &s)
void setSecurityClassification(const ossimString &s)
void setGovSpecNumber(const ossimString &s)

◆ operator=()

const ossimRpfHeader & ossimRpfHeader::operator= ( const ossimRpfHeader rhs)

assignment operator

Definition at line 108 of file ossimRpfHeader.cpp.

References m_countryCode, m_fileName, m_govSpecDate, m_govSpecNumber, m_headerSectionLength, m_littleBigEndianIndicator, m_locationSection, m_locSectionLoc, m_newRepUpIndicator, m_securityClassification, and m_securityReleaseMarking.

109 {
110  if ( this != &rhs )
111  {
114  memcpy(m_fileName, rhs.m_fileName, 13);
116  memcpy(m_govSpecNumber, rhs.m_govSpecNumber, 16);
117  memcpy(m_govSpecDate, rhs.m_govSpecDate, 9);
119  memcpy(m_countryCode, rhs.m_countryCode, 3);
122 
124  }
125  return *this;
126 }
ossimRpfLocationSection * m_locationSection
ossim_uint32 m_locSectionLoc
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossim_uint8 m_newRepUpIndicator
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
char m_countryCode[3]
ossim_uint16 m_headerSectionLength

◆ parseStream()

void ossimRpfHeader::parseStream ( std::istream &  in)
virtual

Parse method.

Parameters
inStream to parse.

Definition at line 137 of file ossimRpfHeader.cpp.

References ossim::byteOrder(), getByteOrder(), m_countryCode, m_fileName, m_govSpecDate, m_govSpecNumber, m_headerSectionLength, m_littleBigEndianIndicator, m_locationSection, m_locSectionLoc, m_newRepUpIndicator, m_securityClassification, m_securityReleaseMarking, ossimRpfLocationSection::parseStream(), and ossimEndian::swap().

Referenced by ossimRpfFrameFileReader::parseFile().

138 {
139  if(in)
140  {
141  in.read((char*)&m_littleBigEndianIndicator, 1);
142 
143  in.read((char*)&m_headerSectionLength, 2);
144  in.read((char*)m_fileName, 12);
145  in.read((char*)&m_newRepUpIndicator, 1);
146  in.read((char*)m_govSpecNumber, 15);
147  in.read((char*)m_govSpecDate, 8);
148  in.read((char*)m_securityClassification, 1);
149  in.read((char*)m_countryCode, 2);
150  in.read((char*)m_securityReleaseMarking, 2);
151  in.read((char*)&m_locSectionLoc, 4);
152 
153  m_fileName[12] = '\0';
154  m_govSpecNumber[15] = '\0';
155  m_govSpecDate[8] = '\0';
156  m_securityClassification[1] = '\0';
157  m_countryCode[2] = '\0';
158  m_securityReleaseMarking[2] = '\0';
159 
160  //---
161  // From spec: MIL-PRF-89038CARDG m_littleBigEndianIndicator shall
162  // be 0x00 for all data denoting big endian storage. We will test
163  // anyway just in case...
164  //---
165  ossimByteOrder dataByteOrder = getByteOrder();
166 
167  if( ossim::byteOrder() != dataByteOrder )
168  {
169  ossimEndian anEndian;
170  anEndian.swap(m_headerSectionLength);
171  anEndian.swap(m_locSectionLoc);
172  }
173 
174  std::streamoff saveGet = in.tellg();
175  in.seekg(m_locSectionLoc, ios::beg);
176  m_locationSection->parseStream(in, dataByteOrder);
177  in.seekg(saveGet, ios::beg);
178  }
179 }
ossimRpfLocationSection * m_locationSection
ossim_uint32 m_locSectionLoc
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
virtual ossimErrorCode parseStream(std::istream &in, ossimByteOrder endianOrder)
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossimByteOrder
ossim_uint8 m_newRepUpIndicator
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
virtual ossimByteOrder getByteOrder() const
char m_countryCode[3]
ossim_uint16 m_headerSectionLength
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

◆ print()

std::ostream & ossimRpfHeader::print ( std::ostream &  out,
const std::string &  prefix = std::string() 
) const
virtual

print method that outputs a key/value type format adding prefix to keys.

Parameters
outString to output to.
prefixThis will be prepended to key. e.g. Where prefix = "nitf." and key is "file_name" key becomes: "nitf.file_name:"
Returns
output stream.

Reimplemented from ossimNitfRegisteredTag.

Definition at line 231 of file ossimRpfHeader.cpp.

References m_littleBigEndianIndicator.

Referenced by ossimRpfFrameFileReader::print(), and ossimRpfToc::printHeader().

232 {
233  out << prefix << "byte_order: "
234  << (m_littleBigEndianIndicator==0x00?"big_endian\n":"little_endian\n")
235  << prefix << HEADER_SECTION_LENGTH_KW << ": "
236  << m_headerSectionLength << "\n"
237  << prefix << ossimKeywordNames::FILENAME_KW << ": "
238  << m_fileName << "\n"
239  << prefix << NEW_REP_UP_INDICATOR_KW << ": "
240  << int(m_newRepUpIndicator) << "\n"
241  << prefix << GOV_SPEC_NUMBER_KW << ": "
242  << m_govSpecNumber << "\n"
243  << prefix << GOV_SPEC_DATE_KW << ": "
244  << m_govSpecDate << "\n"
245  << prefix << SECURITY_CLASSIFICATION_KW << ": "
246  << m_securityClassification << "\n"
247  << prefix << COUNTRY_CODE_KW << ": "
248  << m_countryCode << "\n"
249  << prefix << SECURITY_RELEASE_MARKING_KW << ": "
250  << m_securityReleaseMarking << "\n";
251 
252  if ( traceDebug() )
253  {
254  out << prefix << "LocSectionLoc: "
255  << m_locSectionLoc << "\n";
256  if (m_locationSection)
257  {
258  m_locationSection->print(out, prefix);
259  }
260  }
261 
262  return out;
263 }
ossimRpfLocationSection * m_locationSection
ossim_uint32 m_locSectionLoc
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossim_uint8 m_newRepUpIndicator
std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
char m_countryCode[3]
ossim_uint16 m_headerSectionLength
static const char * FILENAME_KW

◆ setCountryCode()

void ossimRpfHeader::setCountryCode ( const ossimString s)

Definition at line 809 of file ossimRpfHeader.cpp.

References m_countryCode, and ossimNitfCommon::setField().

810 {
812 }
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.
char m_countryCode[3]

◆ setFilename()

void ossimRpfHeader::setFilename ( const ossimString file)

Definition at line 780 of file ossimRpfHeader.cpp.

References m_fileName, and ossimNitfCommon::setField().

781 {
783 }
char m_fileName[13]
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ setGovSpecDate()

void ossimRpfHeader::setGovSpecDate ( const ossimString s)

Definition at line 799 of file ossimRpfHeader.cpp.

References m_govSpecDate, and ossimNitfCommon::setField().

800 {
802 }
char m_govSpecDate[9]
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ setGovSpecNumber()

void ossimRpfHeader::setGovSpecNumber ( const ossimString s)

Definition at line 794 of file ossimRpfHeader.cpp.

References m_govSpecNumber, and ossimNitfCommon::setField().

795 {
797 }
char m_govSpecNumber[16]
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ setLocationSectionPos()

void ossimRpfHeader::setLocationSectionPos ( std::streamoff  off)

Definition at line 819 of file ossimRpfHeader.cpp.

References m_locSectionLoc.

820 {
821  m_locSectionLoc = static_cast<ossim_uint32>(off);
822 }
ossim_uint32 m_locSectionLoc
unsigned int ossim_uint32

◆ setNewRepUpIndicator()

void ossimRpfHeader::setNewRepUpIndicator ( const ossimString s)

Definition at line 785 of file ossimRpfHeader.cpp.

References ossimString::begin(), m_newRepUpIndicator, and ossimString::size().

786 {
787  if (s.size())
788  {
789  // Range check maybe??? (drb)
790  m_newRepUpIndicator = static_cast<ossim_uint8>(*s.begin());
791  }
792 }
std::string::size_type size() const
Definition: ossimString.h:405
std::string::iterator begin()
Definition: ossimString.h:420
ossim_uint8 m_newRepUpIndicator
unsigned char ossim_uint8

◆ setSecurityClassification()

void ossimRpfHeader::setSecurityClassification ( const ossimString s)

Definition at line 804 of file ossimRpfHeader.cpp.

References m_securityClassification, and ossimNitfCommon::setField().

805 {
807 }
char m_securityClassification[2]
1 byte field that can have the values
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ setSecurityReleaseMarking()

void ossimRpfHeader::setSecurityReleaseMarking ( const ossimString s)

Definition at line 814 of file ossimRpfHeader.cpp.

References m_securityReleaseMarking, and ossimNitfCommon::setField().

815 {
817 }
char m_securityReleaseMarking[3]
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ writeStream()

void ossimRpfHeader::writeStream ( std::ostream &  out)
virtual

Write method.

Parameters
outStream to write to.

Definition at line 181 of file ossimRpfHeader.cpp.

References ossim::byteOrder(), getByteOrder(), m_countryCode, m_fileName, m_govSpecDate, m_govSpecNumber, m_headerSectionLength, m_littleBigEndianIndicator, m_locationSection, m_locSectionLoc, m_newRepUpIndicator, m_securityClassification, m_securityReleaseMarking, ossimNotify(), ossimNotifyLevel_NOTICE, ossimEndian::swap(), and ossimRpfLocationSection::writeStream().

182 {
183  // Always write in big endian.
184  if (m_littleBigEndianIndicator != 0x00)
185  {
187  << "ossimRpfHeader::writeStream writing in big endian even though"
188  << " the m_littleBigEndianIndicator is set to little endian."
189  << std::endl;
191  }
192 
193  ossimByteOrder dataByteOrder = getByteOrder();
194 
195  if( ossim::byteOrder() != dataByteOrder )
196  {
197  ossimEndian anEndian;
198  anEndian.swap(m_headerSectionLength);
199  anEndian.swap(m_locSectionLoc);
200  }
201 
202  out.write((char*)&m_littleBigEndianIndicator, 1);
203 
204  out.write((char*)&m_headerSectionLength, 2);
205  out.write((char*)m_fileName, 12);
206  out.write((char*)&m_newRepUpIndicator, 1);
207  out.write((char*)m_govSpecNumber, 15);
208  out.write((char*)m_govSpecDate, 8);
209  out.write((char*)m_securityClassification, 1);
210  out.write((char*)m_countryCode, 2);
211  out.write((char*)m_securityReleaseMarking, 2);
212  out.write((char*)&m_locSectionLoc, 4);
213 
214  if( ossim::byteOrder() != dataByteOrder )
215  {
216  // Must swap things back or we will seek to a bad location.
217  ossimEndian anEndian;
218  anEndian.swap(m_headerSectionLength);
219  anEndian.swap(m_locSectionLoc);
220  }
221 
222  if (m_locSectionLoc) // May or may not be set.
223  {
224  std::streampos pos = out.tellp();
225  out.seekp(m_locSectionLoc, ios::beg);
227  out.seekp(pos);
228  }
229 }
ossimRpfLocationSection * m_locationSection
void writeStream(std::ostream &out)
Write method.
ossim_uint32 m_locSectionLoc
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
char m_securityReleaseMarking[3]
ossim_uint8 m_littleBigEndianIndicator
0x00 = big, 0xff = little
char m_fileName[13]
char m_govSpecDate[9]
ossimByteOrder
ossim_uint8 m_newRepUpIndicator
char m_govSpecNumber[16]
char m_securityClassification[2]
1 byte field that can have the values
virtual ossimByteOrder getByteOrder() const
char m_countryCode[3]
ossim_uint16 m_headerSectionLength
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ m_countryCode

char ossimRpfHeader::m_countryCode[3]
private

Definition at line 173 of file ossimRpfHeader.h.

Referenced by operator=(), ossimRpfHeader(), parseStream(), setCountryCode(), and writeStream().

◆ m_fileName

char ossimRpfHeader::m_fileName[13]
private

Definition at line 159 of file ossimRpfHeader.h.

Referenced by operator=(), ossimRpfHeader(), parseStream(), setFilename(), and writeStream().

◆ m_govSpecDate

char ossimRpfHeader::m_govSpecDate[9]
private

◆ m_govSpecNumber

char ossimRpfHeader::m_govSpecNumber[16]
private

◆ m_headerSectionLength

ossim_uint16 ossimRpfHeader::m_headerSectionLength
private

Definition at line 158 of file ossimRpfHeader.h.

Referenced by operator=(), parseStream(), and writeStream().

◆ m_littleBigEndianIndicator

ossim_uint8 ossimRpfHeader::m_littleBigEndianIndicator
private

0x00 = big, 0xff = little

Definition at line 157 of file ossimRpfHeader.h.

Referenced by getByteOrder(), operator=(), parseStream(), print(), and writeStream().

◆ m_locationSection

ossimRpfLocationSection* ossimRpfHeader::m_locationSection
private

◆ m_locSectionLoc

ossim_uint32 ossimRpfHeader::m_locSectionLoc
private

◆ m_newRepUpIndicator

ossim_uint8 ossimRpfHeader::m_newRepUpIndicator
private

Definition at line 160 of file ossimRpfHeader.h.

Referenced by operator=(), parseStream(), setNewRepUpIndicator(), and writeStream().

◆ m_securityClassification

char ossimRpfHeader::m_securityClassification[2]
private

1 byte field that can have the values

U Unclassified R Restricted C Confidential S Secret T Top Secret

Definition at line 172 of file ossimRpfHeader.h.

Referenced by getSecurityClassification(), operator=(), ossimRpfHeader(), parseStream(), setSecurityClassification(), and writeStream().

◆ m_securityReleaseMarking

char ossimRpfHeader::m_securityReleaseMarking[3]
private

The documentation for this class was generated from the following files: