Václav Kubernát | cbdc98a | 2021-01-28 13:24:37 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 11 | namespace 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 | */ |
| 21 | const 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 | */ |
| 27 | std::shared_ptr<libyang::Data_Node> getSubtree(const std::shared_ptr<libyang::Data_Node>& start, const char* path); |