#include <NitfTreParserShell.h>

Public Member Functions | |
| TreParserShell () | |
| ~TreParserShell () | |
| std::string | getShortDescription () const |
| bool | runOperationalTests (Progress *pProgress, std::ostream &failure) |
| TreState | isTreValid (const DynamicObject &tre, std::ostream &reporter) const |
| bool | ossimTagToDynamicObject (const ossimNitfRegisteredTag &input, DynamicObject &output, std::string &errorMessage) const |
| bool | toDynamicObject (std::istream &input, size_t numBytes, DynamicObject &output, std::string &errorMessage) const |
| bool | ossimTagFromDynamicObject (const DynamicObject &input, ossimNitfRegisteredTag &tre, std::string &errorMessage) const |
| bool | fromDynamicObject (const DynamicObject &input, std::ostream &output, size_t &numBytesWritten, std::string &errorMessage) const |
| bool | importMetadata (const DynamicObject &tre, RasterDataDescriptor &descriptor, std::string &errorMessage) const |
| TreExportStatus | exportMetadata (const RasterDataDescriptor &descriptor, const RasterFileDescriptor &exportDescriptor, DynamicObject &tre, unsigned int &ownerIndex, std::string &tagType, std::string &errorMessage) const |
TreParser developers should take this class and extend it to support their importer specific code.
Definition at line 27 of file NitfTreParserShell.h.
| Nitf::TreParserShell::TreParserShell | ( | ) |
| Nitf::TreParserShell::~TreParserShell | ( | ) |
| std::string Nitf::TreParserShell::getShortDescription | ( | ) | const [virtual] |
Returns a short description for the plug-in.
This method returns a short 50-charater or less description about the plug-in. This short description is used for brief descriptive table entries in the GUI.
Reimplemented from PlugInShell.
| bool Nitf::TreParserShell::runOperationalTests | ( | Progress * | pProgress, | |
| std::ostream & | failure | |||
| ) | [virtual] |
Executes operational tests generically.
This method is used to run basic tests and to make sure the plug-in is operating properly. Running this method on all plug-ins can be used to relatively quickly determine if the application has been installed properly and all plug-ins are operational.
| pProgress | On input, pProgress provides an object for the plug-in to update the progress of the testing. This allows the application to update the user with a progress dialog and to show current status. | |
| failure | On output, failure is an output stream in which the plug-in can record detailed formatted text about what went wrong in with the test. This parameter should not be used to record general status information. Nothing should be logged to this stream unless the tests failed and false is returned from the method. |
Implements Testable.
| TreState Nitf::TreParserShell::isTreValid | ( | const DynamicObject & | tre, | |
| std::ostream & | reporter | |||
| ) | const [virtual] |
Examine the TRE to determine if it is valid.
| tre | The TRE to examine. | |
| reporter | Write to this ostream with information regarding a TreState::SUSPECT or TreState::INVALID TRE. |
Implements Nitf::TreParser.
| bool Nitf::TreParserShell::ossimTagToDynamicObject | ( | const ossimNitfRegisteredTag & | input, | |
| DynamicObject & | output, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Load the TRE directly from an ossimNitfRegisteredTag.
Implementers should implement either this function or toDynamicObject(std::istream&, size_t, DynamicObject&) const to load the TRE.
| input | The ossimNitfRegisteredTag to read from. | |
| output | The DynamicObject to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
Implements Nitf::TreParser.
| bool Nitf::TreParserShell::toDynamicObject | ( | std::istream & | input, | |
| size_t | numBytes, | |||
| DynamicObject & | output, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Load the TRE from an istream.
Implementers should implement either this function or ossimTagToDynamicObject(ossimNitfRegisteredTag&, DynamicObject&) const to load the TRE. This function will only be called if the other returned false.
| input | The istream to read from. The data within does not include the CETAG or CEL fields. | |
| numBytes | The number of bytes to read. | |
| output | The DynamicObject to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
Implements Nitf::TreParser.
| bool Nitf::TreParserShell::ossimTagFromDynamicObject | ( | const DynamicObject & | input, | |
| ossimNitfRegisteredTag & | tre, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Write the TRE directly to an ossimNitfRegisteredTag.
Implementers should implement either this function or fromDynamicObject(const DynamicObject&, std::ostream&, size_t&) const to write the TRE.
| input | The DynamicObject to read from. | |
| tre | The ossimNitfRegisteredTag to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implements Nitf::TreParser.
| bool Nitf::TreParserShell::fromDynamicObject | ( | const DynamicObject & | input, | |
| std::ostream & | output, | |||
| size_t & | numBytesWritten, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Write the TRE from a DynamicObject into an ostream.
Implementers should implement either this function or ossimTagFromDynamicObject(const DynamicObject&, ossimNitfRegisteredTag&) const to write the TRE. This function will only be called if the other returned false.
| input | The DynamicObject to read from. | |
| output | The ostream to write to. Do not write the CETAG or CEL. | |
| numBytesWritten | The number of bytes written. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implements Nitf::TreParser.
| bool Nitf::TreParserShell::importMetadata | ( | const DynamicObject & | tre, | |
| RasterDataDescriptor & | descriptor, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Import contents of the TRE to specific fields within the descriptor.
For example, a TRE might contain wavelength data which would be appropriately represented in the Special Metadata.
| tre | The parsed TRE to place copies of data within the descriptor. | |
| descriptor | The descriptor to place copies of data within. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
true if the operation successfully populated the descriptor, false otherwise. This method should return false if there is no need to import metadata into the descriptor.
Implements Nitf::TreParser.
| TreExportStatus Nitf::TreParserShell::exportMetadata | ( | const RasterDataDescriptor & | descriptor, | |
| const RasterFileDescriptor & | exportDescriptor, | |||
| DynamicObject & | tre, | |||
| unsigned int & | ownerIndex, | |||
| std::string & | tagType, | |||
| std::string & | errorMessage | |||
| ) | const [virtual] |
Export contents descriptor into a tre.
For example, a TRE might contain wavelength data which would be appropriately represented in the Special Metadata.
This method can also be used to modify or create new TREs on export. This might be desired if the TRE must be modified when chipping, or to create a TRE for a dataset not initially loaded as a NITF.
| descriptor | The data descriptor to export from. | |
| exportDescriptor | The descriptor which specifies which portion is to be exported. | |
| tre | On return, this should contain the TRE to export with a future call to fromDynamicObject(). | |
| ownerIndex | When returning TreExportStatus::REPLACE, specifies the index of the owner of this tag. This should be set to 0 for the file header and 1 for the image subheader. If this value is unspecified, it will default to the image subheader. | |
| tagType | When returning TreExportStatus::REPLACE, specifies the type of this tag. Valid values are "UDHD" "UDID", "XHD", and "IXSHD". If this value is unspecified, it will default to "IXSHD". | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implements Nitf::TreParser.