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

#include <ossimRpfFrameFileReader.h>

Public Member Functions

 ossimRpfFrameFileReader ()
 
 ~ossimRpfFrameFileReader ()
 
ossimErrorCode parseFile (const ossimFilename &fileName)
 
std::ostream & print (std::ostream &out) const
 
const ossimRpfHeadergetRpfHeader () const
 

Private Member Functions

void clearAll ()
 

Private Attributes

ossimRefPtr< ossimRpfHeadertheRpfHeader
 
ossimFilename theFilename
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimRpfFrameFileReader &data)
 

Detailed Description

Definition at line 11 of file ossimRpfFrameFileReader.h.

Constructor & Destructor Documentation

◆ ossimRpfFrameFileReader()

ossimRpfFrameFileReader::ossimRpfFrameFileReader ( )

Definition at line 25 of file ossimRpfFrameFileReader.cpp.

26  :theRpfHeader(0),
27  theFilename("")
28 {
29 }
ossimRefPtr< ossimRpfHeader > theRpfHeader

◆ ~ossimRpfFrameFileReader()

ossimRpfFrameFileReader::~ossimRpfFrameFileReader ( )

Definition at line 31 of file ossimRpfFrameFileReader.cpp.

References theRpfHeader.

32 {
33  theRpfHeader = 0;
34 }
ossimRefPtr< ossimRpfHeader > theRpfHeader

Member Function Documentation

◆ clearAll()

void ossimRpfFrameFileReader::clearAll ( )
private

Definition at line 104 of file ossimRpfFrameFileReader.cpp.

References theFilename, and theRpfHeader.

Referenced by parseFile().

105 {
106  theRpfHeader = 0;
107  theFilename = "";
108 }
ossimRefPtr< ossimRpfHeader > theRpfHeader

◆ getRpfHeader()

const ossimRpfHeader * ossimRpfFrameFileReader::getRpfHeader ( ) const

Definition at line 99 of file ossimRpfFrameFileReader.cpp.

References ossimRefPtr< T >::get(), and theRpfHeader.

100 {
101  return theRpfHeader.get();
102 }
ossimRefPtr< ossimRpfHeader > theRpfHeader

◆ parseFile()

ossimErrorCode ossimRpfFrameFileReader::parseFile ( const ossimFilename fileName)

Definition at line 36 of file ossimRpfFrameFileReader.cpp.

References ossimString::c_str(), clearAll(), ossimNitfFileHeader::getTag(), ossimNitfTagInformation::getTagDataOffset(), ossimNitfTagInformation::getTagName(), ossimErrorCodes::OSSIM_ERROR, ossimErrorCodes::OSSIM_OK, ossimRpfHeader::parseStream(), theFilename, theRpfHeader, and ossimRefPtr< T >::valid().

37 {
38  std::ifstream in(fileName.c_str(), ios::in | ios::binary);
40 
41  if(!in)
42  {
44  }
45  clearAll();
46  nitfFile->parseFile(fileName);
47  const ossimRefPtr<ossimNitfFileHeader> nitfFileHeader =
48  nitfFile->getHeader();
49  if(!nitfFileHeader)
50  {
51  nitfFile = 0;
53  }
54 
56  nitfFileHeader->getTag(info, "RPFHDR");
57  // we no longer need access to the nitf header. We got what we needed
58  nitfFile = 0;
59  theFilename = fileName;
60  if(info.getTagName() == "RPFHDR")
61  {
63 
64  // set the get pointer for the stream to the start
65  // of the Rpf header data
66  in.seekg(info.getTagDataOffset());
67 
68  // now get the header data. We do not need to pass in the byte order.
69  // this is grabbed from the first byte of the stream. To see this,
70  // Look at the RpfHeader implementation.
71  theRpfHeader->parseStream(in); // ==ossimErrorCodes::OSSIM_OK)
72  if ( in.fail() )
73  {
74  theRpfHeader = 0;
75  }
76  }
77  else
78  {
80  }
81 
82  if( !theRpfHeader.valid() )
83  {
85  }
86 
88 }
static const ossimErrorCode OSSIM_OK
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint64 getTagDataOffset() const
static const ossimErrorCode OSSIM_ERROR
ossimRefPtr< ossimRpfHeader > theRpfHeader
virtual bool getTag(ossimNitfTagInformation &tagInfo, const ossimString &tagName) const
virtual void parseStream(std::istream &in)
Parse method.
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

◆ print()

std::ostream & ossimRpfFrameFileReader::print ( std::ostream &  out) const

Definition at line 90 of file ossimRpfFrameFileReader.cpp.

References ossimRpfHeader::print(), theRpfHeader, and ossimRefPtr< T >::valid().

Referenced by operator<<().

91 {
92  if( theRpfHeader.valid() )
93  {
94  theRpfHeader->print(out, std::string(""));
95  }
96  return out;
97 }
bool valid() const
Definition: ossimRefPtr.h:75
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.
ossimRefPtr< ossimRpfHeader > theRpfHeader

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimRpfFrameFileReader data 
)
friend

Definition at line 20 of file ossimRpfFrameFileReader.cpp.

21 {
22  return data.print(out);
23 }
std::ostream & print(std::ostream &out) const

Member Data Documentation

◆ theFilename

ossimFilename ossimRpfFrameFileReader::theFilename
private

Definition at line 27 of file ossimRpfFrameFileReader.h.

Referenced by clearAll(), and parseFile().

◆ theRpfHeader

ossimRefPtr<ossimRpfHeader> ossimRpfFrameFileReader::theRpfHeader
private

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