![]() |
RDB 2
|
Manage point cloud meta data. More...
#include <metaData.hpp>
Public Member Functions | |
MetaData (riegl::rdb::PointcloudData *pointcloud) | |
Constructor. More... | |
std::vector< std::string > | list () const |
Query property names. More... | |
bool | exists (const std::string &name) const |
Check if property exists. More... | |
void | set (const std::string &name, const std::string &value) |
Set property value. More... | |
std::string | get (const std::string &name, const std::string &defaultValue="") const |
Get property value. More... | |
void | remove (const std::string &name) |
Delete property. More... | |
void | validate (const std::string &name) |
Validate property value. More... | |
void | validate (const std::string &value, const std::string &schema) |
Validate value. More... | |
void | createSignature (const std::string &name, const std::uint32_t method, const std::uint32_t key_size, const void *const key_data) |
Create a signature for a metadata entry. More... | |
bool | verifySignature (const std::string &name, const std::uint32_t method, const std::uint32_t key_size, const void *const key_data) const |
Verify the signature of a metadata entry. More... | |
Manage point cloud meta data.
This class allows to manage database-wide properties (aka. "meta-data"). Arbitrary properties can be stored in key-value manner along with the point cloud in the database. This might be used for example to store comments, operator/software name or georeferencing information.
Definition at line 66 of file metaData.hpp.
|
explicit |
Constructor.
void riegl::rdb::pointcloud::MetaData::createSignature | ( | const std::string & | name, |
const std::uint32_t | method, | ||
const std::uint32_t | key_size, | ||
const void *const | key_data | ||
) |
Create a signature for a metadata entry.
The signature is stored next to the metadata entry in the database file and cannot be read out or modified. A transaction must be started first.
Set 'method' to 0 to delete an existing signature ('key_size' and 'key_data' are ignored in this case).
[in] | name | name of metadata entry to sign |
[in] | method | signature method (0: delete, 1: default) |
[in] | key_size | signature encryption key size (at least 32 byte) |
[in] | key_data | signature encryption key buffer |
bool riegl::rdb::pointcloud::MetaData::exists | ( | const std::string & | name | ) | const |
Check if property exists.
[in] | name | property name |
std::string riegl::rdb::pointcloud::MetaData::get | ( | const std::string & | name, |
const std::string & | defaultValue = "" |
||
) | const |
Get property value.
If the given property name could not be found, the function returns the given default value.
[in] | name | property name |
[in] | defaultValue | default value |
std::vector<std::string> riegl::rdb::pointcloud::MetaData::list | ( | ) | const |
Query property names.
void riegl::rdb::pointcloud::MetaData::remove | ( | const std::string & | name | ) |
Delete property.
If the given property name could not be found, this function does not fail.
[in] | name | property name |
void riegl::rdb::pointcloud::MetaData::set | ( | const std::string & | name, |
const std::string & | value | ||
) |
Set property value.
[in] | name | property name |
[in] | value | property value |
void riegl::rdb::pointcloud::MetaData::validate | ( | const std::string & | name | ) |
Validate property value.
This function validates the property given by 'name' against the corresponding built-in schema for RIEGL default metadata entries.
If the value does not correspond to the schema, an exception is thrown and the reason can be found in the exception details.
[in] | name | name of property to be validated |
void riegl::rdb::pointcloud::MetaData::validate | ( | const std::string & | value, |
const std::string & | schema | ||
) |
Validate value.
This function validates the given JSON value against the JSON schema.
If the value does not correspond to the schema, an exception is thrown and the reason can be found in the exception details.
[in] | value | value to be validated |
[in] | schema | schema to be validated against |
bool riegl::rdb::pointcloud::MetaData::verifySignature | ( | const std::string & | name, |
const std::uint32_t | method, | ||
const std::uint32_t | key_size, | ||
const void *const | key_data | ||
) | const |
Verify the signature of a metadata entry.
Returns 'false' if:
Otherwise returns 'true'.
Set 'method' to 0 to check if a signature exists, no matter if it is valid or not ('key_size' and 'key_data' are ignored in this case).
[in] | name | name of metadata entry to verify |
[in] | method | signature method (0: exists, 1: default) |
[in] | key_size | signature encryption key size (at least 32 byte) |
[in] | key_data | signature encryption key buffer |