OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimInfoBase.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: Base class for Info object.
10 //
11 //----------------------------------------------------------------------------
12 // $Id$
13 
17 #include <sstream>
18 
20  : theOverviewFlag(true)
21 {}
22 
24 {}
25 
27 {
28  std::string connectionString = file.c_str();
29  std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
30  createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
31  if(!str) return false;
32  return open(str, connectionString);
33 }
34 
35 bool ossimInfoBase::open(std::shared_ptr<ossim::istream>& /* str */,
36  const std::string& /* connectionString */)
37 {
38  return false;
39 }
40 
42 {
43  theOverviewFlag = flag;
44 }
45 
47 {
48  return theOverviewFlag;
49 }
50 
52 {
53  // Do a print to a memory stream.
55  print(out);
56 
57  std::istringstream in(out.str());
58  // Give the result to the keyword list.
59  return kwl.parseStream(in);
60 }
61 
63  ossim_uint32 /* entryIndex */ )const
64 {
65  // If this gets hit the specific info object does not support entry indexes.
66  return getKeywordlist( kwl );
67 }
virtual bool open(const ossimFilename &file)
open method.
virtual bool getKeywordlist(ossimKeywordlist &kwl) const
Method to dump info to a keyword list.
void setProcessOverviewFlag(bool flag)
Sets the overview flag.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
Represents serializable keyword/value map.
static StreamFactoryRegistry * instance()
bool getProcessOverviewFlag() const
Method to get the overview flag.
unsigned int ossim_uint32
virtual ~ossimInfoBase()
virtual destructor
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated 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
virtual std::ostream & print(std::ostream &out) const =0
Print method.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
ossimInfoBase()
default constructor