blob: 95260af4585284ec8e2ffd6e8f05c4ae5fd374a6 [file] [log] [blame]
Václav Kubernátcbdc98a2021-01-28 13:24:37 +01001/*
2 * Copyright (C) 2021 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Václav Kubernát <kubernat@cesnet.cz>
5 *
6*/
7
8#pragma once
9#include <memory>
10
11namespace libyang {
12 class Data_Node;
13}
14
15/**
16 * @brief Gets a string value from a node.
17 *
18 * @param node A libyang data node. Mustn't be nullptr. Must be a leaf.
19 *
20 */
21const char* getValueAsString(const std::shared_ptr<libyang::Data_Node>& node);
22
23/** @brief Gets exactly one node based on `path` starting from `start`.
24 *
25 * Throws if there is more than one matching node. Also throws if there aren't any matching nodes.
26 */
27std::shared_ptr<libyang::Data_Node> getSubtree(const std::shared_ptr<libyang::Data_Node>& start, const char* path);