MrSID Decode SDK for LiDAR Reference Manual
1.1.4.4709
|
Metadata is a container for storing metadata about the point cloud. More...
#include <Metadata.h>
Public Member Functions | |
~Metadata (void) | |
Metadata (void) | |
size_t | getNumRecords (void) const |
Get the number of key-value pairs. | |
bool | has (const char *key) const |
Determine if there is a key-value pair with a given key. | |
void | get (size_t idx, const char *&key, const char *&description, MetadataDataType &datatype, const void *&value, size_t &length) const |
Get the key-value pair at a given index. | |
bool | get (const char *key, const char *&description, MetadataDataType &datatype, const void *&value, size_t &length) const |
Get the key-value pair with a given key. | |
size_t | getKeyIndex (const char *key) const |
Find the index of the key-value pair with the given key. | |
const char * | getKey (size_t idx) const |
Get the key name for the given index. | |
const char * | getDescription (size_t idx) const |
Get the description for the given index. | |
MetadataDataType | getDataType (size_t idx) const |
Get the datatype for the given index. | |
const void * | getValue (size_t idx) const |
Get the data buffer for the given index. | |
size_t | getValueLength (size_t idx) const |
Get the data buffer length for the given index. | |
void | add (const char *key, const char *description, MetadataDataType datatype, const void *value, size_t length) |
Add a key-value pair. | |
void | add (const Metadata &meta) |
Add all the key-value pairs from the given Metadata object. | |
void | remove (void) |
Remove all key-value pairs. | |
void | remove (size_t idx) |
Remove the key-value pair at a given index. | |
void | remove (const char *key) |
Remove the first key-value pair with key. | |
void | sort (void) |
Sort the pairs. | |
void | read (StreamReader &stream) |
Wirte metadata to a stream. | |
void | write (StreamWriter &stream) const |
Read metadata from a stream. | |
void | dump (FILE *file) const |
Write the metadata in a human readable format. | |
Protected Attributes | |
RecordStore * | m_records |
The Metadata class is a Key-Value container for storing metadata about the point cloud. It can hold three data types Strings, Arrays of Doubles and Raw binary data (Blobs).
Definition at line 64 of file Metadata.h.
Metadata::~Metadata | ( | void | ) |
Metadata::Metadata | ( | void | ) |
void Metadata::add | ( | const char * | key, |
const char * | description, | ||
MetadataDataType | datatype, | ||
const void * | value, | ||
size_t | length | ||
) |
This method adds a key-value pair to the metadata.
key | the key name |
description | a short description of the metadata (can by NULL) |
datatype | the data type of the value array |
value | the value array |
length | number of elements in the value array. This is ignored for METADATA_DATATYPE_STRING. |
void Metadata::add | ( | const Metadata & | meta | ) |
The method adds all the key-value pairs in meta.
meta | source Metadata object |
void Metadata::dump | ( | FILE * | file | ) | const |
The method writes the metadata in a human readable format.
file | the destination Standard C Library FILE object |
void Metadata::get | ( | size_t | idx, |
const char *& | key, | ||
const char *& | description, | ||
MetadataDataType & | datatype, | ||
const void *& | value, | ||
size_t & | length | ||
) | const |
This method retrieves the idx'th key-value pair. The last 5 arguments are output parameters.
idx | the index of the key-value pair |
key | the key name |
description | a short description of the metadata (can by NULL) |
datatype | the data type of the value array |
value | the value array |
length | number of elements in the value array. |
bool Metadata::get | ( | const char * | key, |
const char *& | description, | ||
MetadataDataType & | datatype, | ||
const void *& | value, | ||
size_t & | length | ||
) | const |
This method retrieves the named key-value pair. The last 4 arguments are output parameters.
key | the key name |
description | a short description of the metadata (can by NULL) |
datatype | the data type of the value array |
value | the value array |
length | number of elements in the value array. |
MetadataDataType Metadata::getDataType | ( | size_t | idx | ) | const |
idx | the index of the key-value pair the datatype |
const char* Metadata::getDescription | ( | size_t | idx | ) | const |
idx | the index of the key-value pair the description (this may be NULL) |
const char* Metadata::getKey | ( | size_t | idx | ) | const |
idx | the index of the key-value pair the key name |
size_t Metadata::getKeyIndex | ( | const char * | key | ) | const |
This method returns the index of the first pair with the given key.
key | the key name |
size_t Metadata::getNumRecords | ( | void | ) | const |
This method returns the number of key-value pairs.
const void* Metadata::getValue | ( | size_t | idx | ) | const |
idx | the index of the key-value pair a pointer to the data array |
size_t Metadata::getValueLength | ( | size_t | idx | ) | const |
idx | the index of the key-value pair the number of elements in the value array |
bool Metadata::has | ( | const char * | key | ) | const |
The method determines if this object has a pair with the given key.
key | the key name |
void Metadata::read | ( | StreamReader & | stream | ) |
This method reads the metadata from a stream in a binary format.
void Metadata::remove | ( | void | ) |
This method removes all the key-value form the container.
void Metadata::remove | ( | size_t | idx | ) |
This method removes the idx'th key-value pair.
idx | the index of the key-value pair |
void Metadata::remove | ( | const char * | key | ) |
This method removes the first key-value pair with the given key.
key | the key name of the key-value pair |
void Metadata::sort | ( | void | ) |
This method sorts the key-value pair list by key name.
void Metadata::write | ( | StreamWriter & | stream | ) | const |
This method reads the metadata from a stream as a binary format.
RecordStore* Metadata::m_records [protected] |
Definition at line 253 of file Metadata.h.