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

NITF info class. More...

#include <ossimNitfInfo.h>

Inheritance diagram for ossimNitfInfo:
ossimInfoBase ossimReferenced

Public Member Functions

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

std::shared_ptr< ossimNitfFilem_nitfFile
 

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

NITF info class.

Encapsulates the dumpnitf functionality.

Definition at line 25 of file ossimNitfInfo.h.

Constructor & Destructor Documentation

◆ ossimNitfInfo()

ossimNitfInfo::ossimNitfInfo ( )

default constructor

Definition at line 19 of file ossimNitfInfo.cpp.

20  : m_nitfFile(0)
21 {
22 }
std::shared_ptr< ossimNitfFile > m_nitfFile
Definition: ossimNitfInfo.h:66

◆ ~ossimNitfInfo()

ossimNitfInfo::~ossimNitfInfo ( )
virtual

virtual destructor

Definition at line 24 of file ossimNitfInfo.cpp.

References m_nitfFile.

25 {
26  m_nitfFile.reset();
27 }
std::shared_ptr< ossimNitfFile > m_nitfFile
Definition: ossimNitfInfo.h:66

Member Function Documentation

◆ getKeywordlist()

bool ossimNitfInfo::getKeywordlist ( ossimKeywordlist kwl,
ossim_uint32  entryIndex 
) const
virtual

Method to dump info to a keyword list.

Parameters
kwlThe keyword list to initialize.
entryIndexEntry to print. Not supported by all info objects yet.
Returns
true on success, false on error.

Reimplemented from ossimInfoBase.

Definition at line 67 of file ossimNitfInfo.cpp.

References m_nitfFile, and ossimKeywordlist::parseStream().

69 {
70  // Do a print to a memory stream.
72  m_nitfFile->print( out, entryIndex );
73 
74  std::istringstream in( out.str() );
75 
76  // Give the result to the keyword list.
77  return kwl.parseStream( in );
78 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
std::shared_ptr< ossimNitfFile > m_nitfFile
Definition: ossimNitfInfo.h:66
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32

◆ open() [1/2]

bool ossimNitfInfo::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 29 of file ossimNitfInfo.cpp.

References ossimString::c_str(), and ossim::StreamFactoryRegistry::instance().

30 {
31  bool result = false;
32 
33  std::string connectionString = file.c_str();
34  std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
35  createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
36 
37  if ( str )
38  {
39  result = open(str, connectionString);
40  }
41  return result;
42 }
virtual bool open(const ossimFilename &file)
open method.
static StreamFactoryRegistry * instance()
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

◆ open() [2/2]

bool ossimNitfInfo::open ( std::shared_ptr< ossim::istream > &  str,
const std::string &  connectionString 
)
virtual

open method.

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

Reimplemented from ossimInfoBase.

Definition at line 44 of file ossimNitfInfo.cpp.

References m_nitfFile.

46 {
47  bool result = false;
48  if ( str )
49  {
50  m_nitfFile = std::make_shared<ossimNitfFile>();
51  result = m_nitfFile->parseStream(ossimFilename(connectionString), *str);
52  }
53  return result;
54 }
std::shared_ptr< ossimNitfFile > m_nitfFile
Definition: ossimNitfInfo.h:66

◆ print()

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

Print method.

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

Implements ossimInfoBase.

Definition at line 56 of file ossimNitfInfo.cpp.

References ossimInfoBase::getProcessOverviewFlag(), and m_nitfFile.

57 {
58  if ( m_nitfFile )
59  {
60  std::string prefix;
61  m_nitfFile->print(out, prefix, getProcessOverviewFlag());
62  }
63  return out;
64 }
std::shared_ptr< ossimNitfFile > m_nitfFile
Definition: ossimNitfInfo.h:66
bool getProcessOverviewFlag() const
Method to get the overview flag.

Member Data Documentation

◆ m_nitfFile

std::shared_ptr<ossimNitfFile> ossimNitfInfo::m_nitfFile
private

Definition at line 66 of file ossimNitfInfo.h.

Referenced by getKeywordlist(), open(), print(), and ~ossimNitfInfo().


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