OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfRegisteredTag.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: ossimNitfRegisteredTag.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_tagName(),
27  m_tagLength(0)
28 {}
29 ossimNitfRegisteredTag::ossimNitfRegisteredTag(const std::string& tagName, ossim_uint32 tagLength)
30  :
31  ossimObject(),
33  m_tagName(tagName),
34  m_tagLength(tagLength)
35 {}
36 
38 {}
39 
41 {
42  // Deprecated:
43  return m_tagName;
44 }
45 
46 const std::string& ossimNitfRegisteredTag::getTagName() const
47 {
48  return m_tagName;
49 }
50 
51 void ossimNitfRegisteredTag::setTagName(const std::string& tagName)
52 {
53  m_tagName = tagName;
54 }
55 
57 {
58  // Deprecated:
59  return getTagLength();
60 }
61 
63 {
64  return m_tagLength;
65 }
66 
68 {
69  m_tagLength = length;
70 }
71 
73 {
74 }
75 
77 {
78  return 0;
79 }
80 
81 void ossimNitfRegisteredTag::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 const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual void getMetadata(ossimKeywordlist &kwl, const char *prefix=0) const
Default interface to populate keyword list with metadata.
Represents serializable keyword/value map.
virtual std::string getRegisterTagName() const
This will return the name of the registered tag 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.
virtual void setTagLength(ossim_uint32 length)
Set the tag length.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.
#define RTTI_DEF2(cls, name, b1, b2)
Definition: ossimRtti.h:493
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual void setTagName(const std::string &tagName)
ossimNitfRegisteredTag()
default constructor
unsigned int ossim_uint32
virtual ossim_uint32 getSizeInBytes() const
Returns the length in bytes of the tag from the CEL or REL field.
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
virtual bool saveState(ossimKeywordlist &kwl, const ossimString &prefix) const
virtual ~ossimNitfRegisteredTag()
destructor
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const