| RDB 2

Public Member Functions | List of all members
riegl::rdb::pointcloud::MetaData Class Reference

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...

## Detailed Description

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.

See also
  riegl::rdb::Pointcloud::metaData()

Definition at line 66 of file metaData.hpp.

## Constructor & Destructor Documentation

## ◆ MetaData()

riegl::rdb::pointcloud::MetaData::MetaData | ( | riegl::rdb::PointcloudData * | pointcloud | ) |
| explicit

Constructor.

Note
  You cannot create new MetaData objects directly, use riegl::rdb::Pointcloud::metaData() instead.

## Member Function Documentation

## ◆ createSignature()

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).

Since
  2.3.0

Parameters

  [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

## ◆ exists()

bool riegl::rdb::pointcloud::MetaData::exists | ( | const std::string & | name | ) | const

Check if property exists.

Note
  Property names are case sensitive (i.e. "name" and "NAME" are different properties).

Returns
  true if a property with given name exists

Parameters

  [in] | name | property name

## ◆ get()

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.

Parameters

  [in] | name | property name
  [in] | defaultValue | default value

## ◆ list()

std::vector<std::string> riegl::rdb::pointcloud::MetaData::list | ( |  | ) | const

Query property names.

Returns
  a list of property names

## ◆ remove()

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.

Parameters

  [in] | name | property name

## ◆ set()

void riegl::rdb::pointcloud::MetaData::set | ( | const std::string & | name,
|  | const std::string & | value
| ) |  |

Set property value.

Note
  Strings are truncated before the first zero byte (if any).

Parameters

  [in] | name | property name
  [in] | value | property value

## ◆ validate() [1/2]

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.

Parameters

  [in] | name | name of property to be validated

## ◆ validate() [2/2]

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.

Parameters

  [in] | value | value to be validated
  [in] | schema | schema to be validated against

## ◆ verifySignature()

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:

- there is no signature for the metadata entry
- the signature does not match the current value
- a wrong signature encryption key was given

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).

Since
  2.3.0

Parameters

  [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

The documentation for this class was generated from the following file:

- riegl/rdb/pointcloud/metaData.hpp