| IOLink 1.11.0

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
iolink::MetadataNodeHelper Class Reference

A collection of functions to handle paths on MetadataNode instances. More...

`#include <iolink/metadata/MetadataNodeHelper.h>`

## Static Public Member Functions
static std::shared_ptr< const MetadataNode > | getNode (std::shared_ptr< const MetadataNode > root, const std::string &path)
| Helper returning child node of given root node using a path.
static bool | exists (std::shared_ptr< const MetadataNode > root, const std::string &path)
| Check if a path exists in the metadata tree.
static std::shared_ptr< const MetadataNode > | createPath (std::shared_ptr< MetadataNode > origin, const std::string &path, std::shared_ptr< VariantDataValue > value)
| Helper allowing to create the given path in given tree origin.

## Detailed Description

A collection of functions to handle paths on MetadataNode instances.

## Member Function Documentation

## ◆ createPath()

static std::shared_ptr< const MetadataNode > iolink::MetadataNodeHelper::createPath | ( | std::shared_ptr< MetadataNode > | origin,
|  | const std::string & | path,
|  | std::shared_ptr< VariantDataValue > | value
| ) |  |
| static

Helper allowing to create the given path in given tree origin.

ex: /MRC/ext/pixelSize" or "MRC/ext/pixelSize" The method will only create missing nodes in given tree origin. If specified, the given value will be affected to last node of the given path ("pixelSize" in above example). If the whole path already exists, the last node will be overwritten with a created one containing given value.

Parameters

  origin | node from where the path must be created
  path | path to create
  value | value to affect to the leaf of given path, null by default

Returns
  the origin node

## ◆ exists()

static bool iolink::MetadataNodeHelper::exists | ( | std::shared_ptr< const MetadataNode > | root,
|  | const std::string & | path
| ) |  |
| static

Check if a path exists in the metadata tree.

Parameters

  root | The node from which to check the path.
  path | The path to test.

## ◆ getNode()

static std::shared_ptr< const MetadataNode > iolink::MetadataNodeHelper::getNode | ( | std::shared_ptr< const MetadataNode > | root,
|  | const std::string & | path
| ) |  |
| static

Helper returning child node of given root node using a path.

ex: "/MRC/ext/pixelSize"

The following paths are equivalent: "/MRC/ext/pixelSize", "MRC/ext/pixelSize", "\\MRC\\ext\\pixelSize" and "MRC\\ext\\pixelSize"

If child node doesn't exist, nullptr is returned.

Warning: Doesn't support wildcards or regexp.

Parameters

  root | root of metadata tree to parse
  path | path of nodes to follow to access to the searched one

Returns
  searched child node if found (nullptr otherwise)

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

- iolink/public/include/iolink/metadata/MetadataNodeHelper.h