MrSID Decode SDK for Raster Reference Manual
9.5.1.4427
|
class for storing metadata associated with an image More...
#include <lti_metadataDatabase.h>
Public Member Functions | |
LTIMetadataDatabase () | |
default constructor More... | |
LTIMetadataDatabase (const LTIMetadataDatabase &) | |
copy constructor More... | |
virtual | ~LTIMetadataDatabase () |
destructor More... | |
lt_int32 | getApproximateSize () const |
get size of metadata database More... | |
void | sort (void) |
Sorts the database records by tag name. More... | |
Add functions | |
LT_STATUS | add (const LTIMetadataRecord &record) |
add a record More... | |
LT_STATUS | add (const LTIMetadataDatabase &database) |
add all the records from a database More... | |
Retrieval functions | |
LT_STATUS | get (const char *tagName, const LTIMetadataRecord *&record) const |
retrieve a record, given a tag name More... | |
LT_STATUS | get (LTIMetadataTag tag, const LTIMetadataRecord *&record) const |
retrieve a record, given a tag number More... | |
bool | has (const char *tagName) const |
lookup a record, given a tag name More... | |
bool | has (LTIMetadataTag tag) const |
lookup a record, given a tag number More... | |
LT_STATUS | getDataByIndex (lt_uint32 index, const LTIMetadataRecord *&record) const |
retrieve a record, given an index number More... | |
lt_uint32 | getIndexCount () const |
get number of records More... | |
Removal functions | |
LT_STATUS | remove (const char *tagName) |
remove a record, given a tag name More... | |
LT_STATUS | remove (LTIMetadataTag tag) |
remove a record, given a tag number More... | |
LT_STATUS | removeAll () |
remove all records More... | |
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.
LTIMetadataDatabase::LTIMetadataDatabase | ( | ) |
This constructor creates an empty metadata database.
LTIMetadataDatabase::LTIMetadataDatabase | ( | const 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 |
lt_int32 LTIMetadataDatabase::getApproximateSize | ( | ) | const |
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 |
LT_STATUS LTIMetadataDatabase::remove | ( | LTIMetadataTag | tag) |
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 |
LT_STATUS LTIMetadataDatabase::removeAll | ( | ) |
This function will remove all the records from the database.
void LTIMetadataDatabase::sort | ( | void | ) |
This can be useful in certain debugging and validation scenarios.
LizardTech |