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

#include <ossimNitfDataExtensionSegmentV2_0.h>

Inheritance diagram for ossimNitfDataExtensionSegmentV2_0:
ossimNitfDataExtensionSegment ossimPropertyInterface ossimObject ossimReferenced

Public Member Functions

 ossimNitfDataExtensionSegmentV2_0 ()
 
virtual ~ossimNitfDataExtensionSegmentV2_0 ()
 
virtual void parseStream (std::istream &in, ossim_uint64 dataLength)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual const std::vector< ossimNitfTagInformation > & getTagList () const
 
ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
- Public Member Functions inherited from ossimNitfDataExtensionSegment
 ossimNitfDataExtensionSegment ()
 
virtual ~ossimNitfDataExtensionSegment ()
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- 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
 

Static Public Attributes

static const ossimString DESTAG_KW = "destag"
 
static const ossimString DESDWNG_KW = "desdwng"
 
static const ossimString DESDEVT_KW = "desdevt"
 
- Static Public Attributes inherited from ossimNitfDataExtensionSegment
static const ossimString DE_KW
 
static const ossimString DESVER_KW
 
static const ossimString DESOFLW_KW = "desoflw"
 
static const ossimString DESITEM_KW = "desitem"
 
static const ossimString DESSHL_KW = "desshl"
 
static const ossimString DESSHF_KW = "desshf"
 
static const ossimString DESDATA_KW = "desdata"
 
static const ossimString DECLAS_KW = "declas"
 
static const ossimString DESCODE_KW = "descode"
 
static const ossimString DESCTLH_KW = "desctlh"
 
static const ossimString DESREL_KW = "desrel"
 
static const ossimString DESCAUT_KW = "descaut"
 
static const ossimString DESCTLN_KW = "desctln"
 

Private Member Functions

void clearFields ()
 

Private Attributes

ossimNitfDataExtIdentSecurityChunkV2_0 theIdentSecurityChunk
 
char theOverflowedHeaderType [7]
 
char theDataItemOverflowed [4]
 
char theLengthOfUserDefinedSubheaderFields [5]
 
std::vector< unsigned char > theUserDefinedSubheaderFields
 
std::vector< unsigned char > theData
 
std::vector< ossimNitfTagInformationtheTagList
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 34 of file ossimNitfDataExtensionSegmentV2_0.h.

Constructor & Destructor Documentation

◆ ossimNitfDataExtensionSegmentV2_0()

ossimNitfDataExtensionSegmentV2_0::ossimNitfDataExtensionSegmentV2_0 ( )

◆ ~ossimNitfDataExtensionSegmentV2_0()

ossimNitfDataExtensionSegmentV2_0::~ossimNitfDataExtensionSegmentV2_0 ( )
virtual

Definition at line 48 of file ossimNitfDataExtensionSegmentV2_0.cpp.

49 {
50 }

Member Function Documentation

◆ clearFields()

void ossimNitfDataExtensionSegmentV2_0::clearFields ( )
private

Definition at line 115 of file ossimNitfDataExtensionSegmentV2_0.cpp.

References theData, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtClassAuthority, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtCodewords, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtControlAndHand, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtDowngradingEvent, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtReleasingInst, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityClass, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityConNum, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityDowngrade, theDataItemOverflowed, ossimNitfDataExtIdentSecurityChunkV2_0::theFilePartType, theIdentSecurityChunk, theLengthOfUserDefinedSubheaderFields, theOverflowedHeaderType, theTagList, ossimNitfDataExtIdentSecurityChunkV2_0::theUniqueDataExtTypeId, theUserDefinedSubheaderFields, and ossimNitfDataExtIdentSecurityChunkV2_0::theVersionDataFieldDef.

Referenced by ossimNitfDataExtensionSegmentV2_0(), and parseStream().

116 {
117 
118  memset(theIdentSecurityChunk.theFilePartType, ' ', 2); // 2 byte alpha
119  memset(theIdentSecurityChunk.theUniqueDataExtTypeId, ' ', 25); // 25 byte alpha numeric
120  memset(theIdentSecurityChunk.theVersionDataFieldDef, ' ', 2); // 2 byte numeric
121  memset(theIdentSecurityChunk.theDataExtSecurityClass, ' ', 1); // 1 byte alpha
122  memset(theIdentSecurityChunk.theDataExtCodewords, ' ', 40); // 40 byte alpha numeric
123  memset(theIdentSecurityChunk.theDataExtControlAndHand, ' ', 40); // 40 byte alpha numeric
124  memset(theIdentSecurityChunk.theDataExtReleasingInst, ' ', 40); // 40 byte alpha numeric
125  memset(theIdentSecurityChunk.theDataExtClassAuthority, ' ', 20); // 20 byte alph num
126  memset(theIdentSecurityChunk.theDataExtSecurityConNum, ' ', 20); // 20 byte alpha num
127  memset(theIdentSecurityChunk.theDataExtSecurityDowngrade, ' ', 6); // 6 byte alpha num
128  memset(theIdentSecurityChunk.theDataExtDowngradingEvent, ' ', 40); // 40 byte alpha num
129  memset(theOverflowedHeaderType, ' ', 6);
130  memset(theDataItemOverflowed, ' ', 3);
132 
133  theIdentSecurityChunk.theFilePartType[2] = '\0'; // 2 byte alpha
134  theIdentSecurityChunk.theUniqueDataExtTypeId[25] = '\0'; // 25 byte alpha numeric
135  theIdentSecurityChunk.theVersionDataFieldDef[2] = '\0'; // 2 byte numeric
136  theIdentSecurityChunk.theDataExtSecurityClass[1] = '\0'; // 1 byte alpha
137  theIdentSecurityChunk.theDataExtCodewords[40] = '\0'; // 40 byte alpha numeric
138  theIdentSecurityChunk.theDataExtControlAndHand[40] = '\0'; // 40 byte alpha numeric
139  theIdentSecurityChunk.theDataExtReleasingInst[40] = '\0'; // 40 byte alpha numeric
140  theIdentSecurityChunk.theDataExtClassAuthority[20] = '\0'; // 20 byte alph num
141  theIdentSecurityChunk.theDataExtSecurityConNum[20] = '\0'; // 20 byte alpha num
142  theIdentSecurityChunk.theDataExtSecurityDowngrade[6] = '\0'; // 6 byte alpha num
143  theIdentSecurityChunk.theDataExtDowngradingEvent[40] = '\0'; // 40 byte alpha num
144  theOverflowedHeaderType[6] = '\0';
145  theDataItemOverflowed[3] = '\0';
147 
149  theData.clear();
150  theTagList.clear();
151 }
ossimNitfDataExtIdentSecurityChunkV2_0 theIdentSecurityChunk
std::vector< ossimNitfTagInformation > theTagList
std::vector< unsigned char > theUserDefinedSubheaderFields

◆ getProperty()

ossimRefPtr< ossimProperty > ossimNitfDataExtensionSegmentV2_0::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimPropertyInterface.

Definition at line 169 of file ossimNitfDataExtensionSegmentV2_0.cpp.

References ossimNitfDataExtensionSegment::DE_KW, ossimNitfDataExtensionSegment::DECLAS_KW, ossimNitfDataExtensionSegment::DESCAUT_KW, ossimNitfDataExtensionSegment::DESCODE_KW, ossimNitfDataExtensionSegment::DESCTLH_KW, ossimNitfDataExtensionSegment::DESCTLN_KW, ossimNitfDataExtensionSegment::DESDATA_KW, DESDEVT_KW, DESDWNG_KW, ossimNitfDataExtensionSegment::DESITEM_KW, ossimNitfDataExtensionSegment::DESOFLW_KW, ossimNitfDataExtensionSegment::DESREL_KW, ossimNitfDataExtensionSegment::DESSHF_KW, ossimNitfDataExtensionSegment::DESSHL_KW, DESTAG_KW, ossimNitfDataExtensionSegment::DESVER_KW, theData, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtClassAuthority, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtCodewords, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtControlAndHand, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtDowngradingEvent, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtReleasingInst, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityClass, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityConNum, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityDowngrade, theDataItemOverflowed, ossimNitfDataExtIdentSecurityChunkV2_0::theFilePartType, theIdentSecurityChunk, theLengthOfUserDefinedSubheaderFields, theOverflowedHeaderType, ossimNitfDataExtIdentSecurityChunkV2_0::theUniqueDataExtTypeId, theUserDefinedSubheaderFields, ossimNitfDataExtIdentSecurityChunkV2_0::theVersionDataFieldDef, and ossimString::trim().

170 {
171  ossimProperty* property = 0;
172  if (name == DE_KW)
173  {
175  }
176  else if (name == DESTAG_KW)
177  {
179  }
180  else if (name == DESVER_KW)
181  {
183  }
184  else if (name == DECLAS_KW)
185  {
187  }
188  else if (name == DESCODE_KW)
189  {
191  }
192  else if (name == DESCTLH_KW)
193  {
195  }
196  else if (name == DESREL_KW)
197  {
199  }
200  else if (name == DESCAUT_KW)
201  {
203  }
204  else if (name == DESCTLN_KW)
205  {
207  }
208  else if (name == DESDWNG_KW)
209  {
211  }
212  else if (name == DESDEVT_KW)
213  {
215  }
216  else if (name == DESOFLW_KW)
217  {
218  property = new ossimStringProperty(name, ossimString(theOverflowedHeaderType).trim());
219  }
220  else if (name == DESITEM_KW)
221  {
222  property = new ossimStringProperty(name, ossimString(theDataItemOverflowed).trim());
223  }
224  else if (name == DESSHL_KW)
225  {
227  }
228  else if (name == DESSHF_KW)
229  {
231  }
232  else if (name == DESDATA_KW)
233  {
234  // Only valid if setTagList has not been called on this object.
235  property = new ossimBinaryDataProperty(name, theData);
236  }
237 
238  return property;
239 }
ossimNitfDataExtIdentSecurityChunkV2_0 theIdentSecurityChunk
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
std::vector< unsigned char > theUserDefinedSubheaderFields

◆ getPropertyNames()

void ossimNitfDataExtensionSegmentV2_0::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimNitfDataExtensionSegment.

Definition at line 241 of file ossimNitfDataExtensionSegmentV2_0.cpp.

References DESDEVT_KW, DESDWNG_KW, DESTAG_KW, and ossimNitfDataExtensionSegment::getPropertyNames().

242 {
244  propertyNames.push_back(DESTAG_KW);
245  propertyNames.push_back(DESDWNG_KW);
246  propertyNames.push_back(DESDEVT_KW);
247 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ getTagList()

virtual const std::vector<ossimNitfTagInformation>& ossimNitfDataExtensionSegmentV2_0::getTagList ( ) const
inlinevirtual

Implements ossimNitfDataExtensionSegment.

Definition at line 41 of file ossimNitfDataExtensionSegmentV2_0.h.

42  {
43  return theTagList;
44  }
std::vector< ossimNitfTagInformation > theTagList

◆ parseStream()

void ossimNitfDataExtensionSegmentV2_0::parseStream ( std::istream &  in,
ossim_uint64  dataLength 
)
virtual

Implements ossimNitfDataExtensionSegment.

Definition at line 52 of file ossimNitfDataExtensionSegmentV2_0.cpp.

References clearFields(), ossimNitfTagInformation::parseStream(), theData, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtClassAuthority, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtCodewords, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtControlAndHand, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtDowngradingEvent, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtReleasingInst, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityClass, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityConNum, ossimNitfDataExtIdentSecurityChunkV2_0::theDataExtSecurityDowngrade, theDataItemOverflowed, ossimNitfDataExtIdentSecurityChunkV2_0::theFilePartType, theIdentSecurityChunk, theLengthOfUserDefinedSubheaderFields, theOverflowedHeaderType, theTagList, ossimNitfDataExtIdentSecurityChunkV2_0::theUniqueDataExtTypeId, theUserDefinedSubheaderFields, ossimNitfDataExtIdentSecurityChunkV2_0::theVersionDataFieldDef, ossimString::toLong(), ossimString::trim(), and ossimString::upcase().

53 {
54  if(in)
55  {
56  clearFields();
57 
58  in.read(theIdentSecurityChunk.theFilePartType, 2); // 2 byte alpha
59  in.read(theIdentSecurityChunk.theUniqueDataExtTypeId, 25); // 25 byte alpha numeric
60  in.read(theIdentSecurityChunk.theVersionDataFieldDef, 2); // 2 byte numeric
61  in.read(theIdentSecurityChunk.theDataExtSecurityClass, 1); // 1 byte alpha
62  in.read(theIdentSecurityChunk.theDataExtCodewords, 40); // 40 byte alpha numeric
63  in.read(theIdentSecurityChunk.theDataExtControlAndHand, 40); // 40 byte alpha numeric
64  in.read(theIdentSecurityChunk.theDataExtReleasingInst, 40); // 40 byte alpha numeric
65  in.read(theIdentSecurityChunk.theDataExtClassAuthority, 20); // 20 byte alph num
66  in.read(theIdentSecurityChunk.theDataExtSecurityConNum, 20); // 20 byte alpha num
67  in.read(theIdentSecurityChunk.theDataExtSecurityDowngrade, 6); // 6 byte alpha num
69  {
70  in.read(theIdentSecurityChunk.theDataExtDowngradingEvent, 40); // 40 byte alpha num
71  }
72 
75  desTag = desTag.trim().upcase();
76  const bool overflow = (desTag == "REGISTERED EXTENSIONS" ||
77  desTag == "CONTROLLED EXTENSIONS");
78 
79  if (overflow&&in.good())
80  {
81  in.read(theOverflowedHeaderType, 6);
82  in.read(theDataItemOverflowed, 3);
83  }
85  // look to see if there is any data and if so read the tag
86  // to see what it is
88  if (length > 0)
89  {
90  theUserDefinedSubheaderFields.resize(length);
91  in.read(reinterpret_cast<char*>(&theUserDefinedSubheaderFields.front()), theUserDefinedSubheaderFields.size());
92  }
93 
94  if (dataLength != 0)
95  {
96  if (overflow)
97  {
98  istream::pos_type dataBegin = in.tellg();
99  istream::pos_type endData = dataBegin + static_cast<istream::pos_type>(dataLength);
100  while (in.good()&&(in.tellg() < endData))
101  {
103  tag.parseStream(in);
104  theTagList.push_back(tag);
105  }
106  if(!in.good()) in.clear();
107  in.seekg(dataBegin);
108  }
109  theData.resize(dataLength);
110  in.read(reinterpret_cast<char*>(&theData.front()), theData.size());
111  }
112  }
113 }
ossimNitfDataExtIdentSecurityChunkV2_0 theIdentSecurityChunk
std::vector< ossimNitfTagInformation > theTagList
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
virtual void parseStream(ossim::istream &in)
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
std::vector< unsigned char > theUserDefinedSubheaderFields
long toLong() const
toLong&#39;s deprecated, please use the toInts...

◆ print()

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

Generic print method.

Derived classes should re-implement as they see fit.

Returns
std::ostream&

Reimplemented from ossimObject.

Definition at line 154 of file ossimNitfDataExtensionSegmentV2_0.cpp.

References theDataItemOverflowed, theIdentSecurityChunk, theLengthOfUserDefinedSubheaderFields, theOverflowedHeaderType, and theTagList.

155 {
156  out << "theIdentSecurityChunk: "
158  << "\ntheOverflowedHeaderType: "
160  << "\ntheDataItemOverflowed: "
162  << "\ntheLengthOfUserDefinedSubheaderFields: "
164  << "\ntag count: "
165  << theTagList.size() << std::endl;
166  return out;
167 }
ossimNitfDataExtIdentSecurityChunkV2_0 theIdentSecurityChunk
std::vector< ossimNitfTagInformation > theTagList

Member Data Documentation

◆ DESDEVT_KW

const ossimString ossimNitfDataExtensionSegmentV2_0::DESDEVT_KW = "desdevt"
static

Definition at line 51 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ DESDWNG_KW

const ossimString ossimNitfDataExtensionSegmentV2_0::DESDWNG_KW = "desdwng"
static

Definition at line 50 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ DESTAG_KW

const ossimString ossimNitfDataExtensionSegmentV2_0::DESTAG_KW = "destag"
static

Definition at line 49 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ theData

std::vector<unsigned char> ossimNitfDataExtensionSegmentV2_0::theData
private

This is an n-byte field, where n is found in the file header.

Definition at line 81 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), and parseStream().

◆ theDataItemOverflowed

char ossimNitfDataExtensionSegmentV2_0::theDataItemOverflowed[4]
private

This is a 3 byte field

Definition at line 66 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), and print().

◆ theIdentSecurityChunk

ossimNitfDataExtIdentSecurityChunkV2_0 ossimNitfDataExtensionSegmentV2_0::theIdentSecurityChunk
private

Definition at line 56 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), and print().

◆ theLengthOfUserDefinedSubheaderFields

char ossimNitfDataExtensionSegmentV2_0::theLengthOfUserDefinedSubheaderFields[5]
private

This is a 4 byte field.

Definition at line 71 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), and print().

◆ theOverflowedHeaderType

char ossimNitfDataExtensionSegmentV2_0::theOverflowedHeaderType[7]
private

This is a 6 byte field

Definition at line 61 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), and print().

◆ theTagList

std::vector<ossimNitfTagInformation> ossimNitfDataExtensionSegmentV2_0::theTagList
private

Definition at line 83 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), parseStream(), and print().

◆ theUserDefinedSubheaderFields

std::vector<unsigned char> ossimNitfDataExtensionSegmentV2_0::theUserDefinedSubheaderFields
private

This is an n-byte field, where n is theLengthOfUserDefinedSubheaderFields.

Definition at line 76 of file ossimNitfDataExtensionSegmentV2_0.h.

Referenced by clearFields(), getProperty(), and parseStream().


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