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

HDF info class. More...

#include <ossimRpfInfo.h>

Inheritance diagram for ossimRpfInfo:
ossimInfoBase ossimReferenced

Public Member Functions

 ossimRpfInfo ()
 default constructor More...
 
virtual ~ossimRpfInfo ()
 virtual destructor More...
 
virtual bool open (const ossimFilename &file)
 open method. More...
 
virtual std::ostream & print (std::ostream &out) const
 Print method. More...
 
bool isOpen ()
 
- Public Member Functions inherited from ossimInfoBase
 ossimInfoBase ()
 default constructor More...
 
virtual bool open (std::shared_ptr< ossim::istream > &str, const std::string &connectionString)
 open method. More...
 
void setProcessOverviewFlag (bool flag)
 Sets the overview flag. More...
 
bool getProcessOverviewFlag () const
 Method to get the overview flag. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl) const
 Method to dump info to a keyword list. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl, ossim_uint32 entryIndex) const
 Method to dump info to a keyword list. More...
 
- 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
 

Private Attributes

ossimFilename theFile
 
ossimFilename m_infoFile
 

Additional Inherited Members

- Protected Member Functions inherited from ossimInfoBase
virtual ~ossimInfoBase ()
 virtual destructor More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimInfoBase
bool theOverviewFlag
 

Detailed Description

HDF info class.

Encapsulates the HDF functionality.

Definition at line 27 of file ossimRpfInfo.h.

Constructor & Destructor Documentation

◆ ossimRpfInfo()

ossimRpfInfo::ossimRpfInfo ( )

default constructor

Definition at line 23 of file ossimRpfInfo.cpp.

24  : ossimInfoBase(),
25  theFile(),
26  m_infoFile()
27 {
28 }
ossimFilename theFile
Definition: ossimRpfInfo.h:58
ossimFilename m_infoFile
Definition: ossimRpfInfo.h:59
ossimInfoBase()
default constructor

◆ ~ossimRpfInfo()

ossimRpfInfo::~ossimRpfInfo ( )
virtual

virtual destructor

Definition at line 30 of file ossimRpfInfo.cpp.

31 {
32 }

Member Function Documentation

◆ isOpen()

bool ossimRpfInfo::isOpen ( )

Definition at line 69 of file ossimRpfInfo.cpp.

References ossimString::downcase(), ossimFilename::ext(), and theFile.

Referenced by open().

70 {
71  ossimString ext = theFile.ext().downcase();
72 
73  if(ext == "rpf")
74  {
75  return true;
76  }
77  else
78  {
79  return false;
80  }
81 }
ossimFilename theFile
Definition: ossimRpfInfo.h:58
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ open()

bool ossimRpfInfo::open ( const ossimFilename file)
virtual

open method.

Parameters
fileFile name to open.
Returns
true on success false on error.

Reimplemented from ossimInfoBase.

Definition at line 34 of file ossimRpfInfo.cpp.

References ossimString::empty(), getline(), isOpen(), m_infoFile, ossimString::split(), and theFile.

35 {
36  theFile = file;
37  if (isOpen())
38  {
39  std::ifstream in((theFile).c_str() );
40 
41  std::string line;
42  int index = 0;
43  while(in.good())
44  {
45  // Read in a line.
46  std::getline(in, line);
47  ossimString tmpStr = ossimString(line);
48  if (index > 0)
49  {
50  if (!tmpStr.empty())
51  {
52  std::vector<ossimString> tmpVector = tmpStr.split("|");
53  if (tmpVector.size() > 0)
54  {
55  m_infoFile = tmpVector[0];
56  break;
57  }
58  }
59  }
60  index++;
61  }
62  in.close();
63 
64  return true;
65  }
66  return false;
67 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
std::istream & getline(std::istream &is, ossimString &str, char delim)
Definition: ossimString.h:916
ossimFilename theFile
Definition: ossimRpfInfo.h:58
ossimFilename m_infoFile
Definition: ossimRpfInfo.h:59
bool empty() const
Definition: ossimString.h:411

◆ print()

std::ostream & ossimRpfInfo::print ( std::ostream &  out) const
virtual

Print method.

Parameters
outStream to print to.
Returns
std::ostream&

Implements ossimInfoBase.

Definition at line 83 of file ossimRpfInfo.cpp.

References ossimInfoFactory::create(), ossimInfoFactory::instance(), and m_infoFile.

84 {
85  std::shared_ptr<ossimInfoBase> info = ossimInfoFactory::instance()->create(m_infoFile);
86  if (info)
87  {
88  info->print(out);
89  }
90 
91  return out;
92 }
static ossimInfoFactory * instance()
ossimFilename m_infoFile
Definition: ossimRpfInfo.h:59
virtual std::shared_ptr< ossimInfoBase > create(const ossimFilename &file) const
create method.

Member Data Documentation

◆ m_infoFile

ossimFilename ossimRpfInfo::m_infoFile
private

Definition at line 59 of file ossimRpfInfo.h.

Referenced by open(), and print().

◆ theFile

ossimFilename ossimRpfInfo::theFile
private

Definition at line 58 of file ossimRpfInfo.h.

Referenced by isOpen(), and open().


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