OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfRegisteredDes.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: Garrett Potts
8 //
9 // Description: Nitf support class
10 //
11 //********************************************************************
12 // $Id: ossimNitfRegisteredDes.cpp 22013 2012-12-19 17:37:20Z dburken $
13 
14 #include <iostream>
15 #include <sstream>
16 #include <string>
17 #include <sstream>
19 
21 
23  :
24  ossimObject(),
26  m_desName(),
27  m_desLength(0)
28 {}
29 ossimNitfRegisteredDes::ossimNitfRegisteredDes(const std::string& desName, ossim_uint32 desLength)
30  :
31  ossimObject(),
33  m_desName(desName),
34  m_desLength(desLength)
35 {}
36 
38 {}
39 
41 {
42  // Deprecated:
43  return m_desName;
44 }
45 
46 const std::string& ossimNitfRegisteredDes::getDesName() const
47 {
48  return m_desName;
49 }
50 
51 void ossimNitfRegisteredDes::setDesName(const std::string& desName)
52 {
53  m_desName = desName;
54 }
55 
57 {
58  // Deprecated:
59  return getDesLength();
60 }
61 
63 {
64  return m_desLength;
65 }
66 
68 {
69  m_desLength = length;
70 }
71 
73 {
74 }
75 
77 {
78  return 0;
79 }
80 
81 void ossimNitfRegisteredDes::getPropertyNames(std::vector<ossimString>& /* propertyNames */)const
82 {
83 }
84 
86  const char* /* prefix */ ) const
87 {
88 }
89 
91  std::ostream& out, const std::string& /* prefix */) const
92 {
93  // return print(out);
94  return out;
95 }
96 
98 {
99  bool result = false;
100  // by default we will use the already implemented print method as backup
101  //
102  std::ostringstream out;
103 
104  print(out);
105 
106  ossimKeywordlist kwlTemp;
107 
108  std::istringstream in(out.str());
109  if(kwlTemp.parseStream(in))
110  {
111  result = true;
112  kwl.add(prefix, kwlTemp);
113  }
114 
115  return result;
116 }
virtual void setDesName(const std::string &desName)
virtual ossim_uint32 getDesLength() const
Returns the length in bytes of the des from the CEL or REL field.
virtual bool saveState(ossimKeywordlist &kwl, const ossimString &prefix) const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
Represents serializable keyword/value map.
virtual std::string getRegisterDesName() const
This will return the name of the registered des for this user defined header.
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Pure virtual print method that outputs a key/value type format adding prefix to keys.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
#define RTTI_DEF2(cls, name, b1, b2)
Definition: ossimRtti.h:493
virtual void setDesLength(ossim_uint32 length)
Set the des length.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual const std::string & getDesName() const
This will return the name of the registered des for this user defined header.
unsigned int ossim_uint32
virtual ~ossimNitfRegisteredDes()
destructor
ossimNitfRegisteredDes()
default constructor
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
virtual void getMetadata(ossimKeywordlist &kwl, const char *prefix=0) const
Default interface to populate keyword list with metadata.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
virtual ossim_uint32 getSizeInBytes() const
Returns the length in bytes of the des from the CEL or REL field.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23