MrSID Decode SDK for Raster Reference Manual
9.5.4.4709
|
class for storing metadata associated with an image More...
#include <lti_metadataDatabase.h>
Public Member Functions | |
LTIMetadataDatabase () | |
default constructor | |
LTIMetadataDatabase (const LTIMetadataDatabase &) | |
copy constructor | |
virtual | ~LTIMetadataDatabase () |
destructor | |
lt_int32 | getApproximateSize () const |
get size of metadata database | |
void | sort (void) |
Sorts the database records by tag name. | |
Add functions | |
LT_STATUS | add (const LTIMetadataRecord &record) |
add a record | |
LT_STATUS | add (const LTIMetadataDatabase &database) |
add all the records from a database | |
Retrieval functions | |
LT_STATUS | get (const char *tagName, const LTIMetadataRecord *&record) const |
retrieve a record, given a tag name | |
LT_STATUS | get (LTIMetadataTag tag, const LTIMetadataRecord *&record) const |
retrieve a record, given a tag number | |
bool | has (const char *tagName) const |
lookup a record, given a tag name | |
bool | has (LTIMetadataTag tag) const |
lookup a record, given a tag number | |
LT_STATUS | getDataByIndex (lt_uint32 index, const LTIMetadataRecord *&record) const |
retrieve a record, given an index number | |
lt_uint32 | getIndexCount () const |
get number of records | |
Removal functions | |
LT_STATUS | remove (const char *tagName) |
remove a record, given a tag name | |
LT_STATUS | remove (LTIMetadataTag tag) |
remove a record, given a tag number | |
LT_STATUS | removeAll () |
remove all records |
This class implements a simple database which holds a set of LTIMetadataRecords. Each record has a unique tag associated with it.
Each LTIImage object contains an LTIMetadataDatabase for the metadata associated with that image.
The database (and records) are stored in memory in a format-neutral manner. For importing or exporting metadata records to permanent storage, see the LTIMetadataReader and LTIMetadataWriter classes.
Definition at line 45 of file lti_metadataDatabase.h.
This constructor creates an empty metadata database.
virtual LTIMetadataDatabase::~LTIMetadataDatabase | ( | ) | [virtual] |
LT_STATUS LTIMetadataDatabase::add | ( | const LTIMetadataRecord & | record | ) |
This function adds the given record to the metadata database.
If the database already contains a record with the given tag, a status code of LT_STS_LTIMetadata_DuplicateTag is returned.
record | the record to add |
LT_STATUS LTIMetadataDatabase::add | ( | const LTIMetadataDatabase & | database | ) |
This function adds all the records from the given database to this database.
If the database already contains a record with the same tag as one of the records in the database being added, no records are added and a status code of LT_STS_LTIMetadata_DuplicateTag is returned.
database | the database containing the records to add |
LT_STATUS LTIMetadataDatabase::get | ( | const char * | tagName, |
const LTIMetadataRecord *& | record | ||
) | const |
This function returns a pointer to the (first) record in the database that matches the given tag name.
If the tag is not found, the pointer will be set to NULL and a status of LT_STS_LTIMetadata_TagNotFound will be returned.
tagName | the name of the tag of the record to retrieve |
record | pointer to the retrieved record |
LT_STATUS LTIMetadataDatabase::get | ( | LTIMetadataTag | tag, |
const LTIMetadataRecord *& | record | ||
) | const |
This function returns a pointer to the (first) record in the database that matches the given tag number.
If the tag is not found, the pointer will be set to NULL and a status of LT_STS_LTIMetadata_TagNotFound will be returned.
tag | the number of the tag of the record to retrieve |
record | pointer to the retrieved record |
This function will return a close-enough estimate of the size of the metadata database, as if it were to be written directly to disk.
LT_STATUS LTIMetadataDatabase::getDataByIndex | ( | lt_uint32 | index, |
const LTIMetadataRecord *& | record | ||
) | const |
This function returns a pointer to the (first) record in the database that matches the given index number.
In combination with getIndexCount(), this function can be used to iterate through all the records in the database. (However, removing a record will change the index numbers, so be careful if iterating and removing in the same loop.)
If the index number is not found, the pointer will be set to NULL and a status of LT_STS_LTIMetadata_TagNotFound will be returned.
index | the index number of the record to retrieve |
record | pointer to the retrieved record |
lt_uint32 LTIMetadataDatabase::getIndexCount | ( | ) | const |
This function will return the number of records in the database.
bool LTIMetadataDatabase::has | ( | const char * | tagName | ) | const |
This function returns a boolean indicating whether the database contains a record with the given tag.
tagName | the name of the tag of the record to look up |
bool LTIMetadataDatabase::has | ( | LTIMetadataTag | tag | ) | const |
This function returns a boolean indicating whether the database contains a record with the given tag.
tag | the number of the tag of the record to look up |
LT_STATUS LTIMetadataDatabase::remove | ( | const char * | tagName | ) |
This function will remove the record with the given tag from the database.
If the tag is not found, a status of LT_STS_LTIMetadata_TagNotFound will be returned.
tagName | the name of the tag of the record to remove |
This function will remove the record with the given tag from the database.
If the tag is not found, a status of LT_STS_LTIMetadata_TagNotFound will be returned.
tag | the number of the tag of the record to remove |
This function will remove all the records from the database.
void LTIMetadataDatabase::sort | ( | void | ) |
This can be useful in certain debugging and validation scenarios.