15 #ifndef LIBYANG_CPP_TREE_DATA_H
16 #define LIBYANG_CPP_TREE_DATA_H
23 #include "Internal.hpp"
59 std::vector<S_Type_Bit>
bit();
65 S_Type_Enum
enm() {
return LY_TYPE_ENUM == value_type ? std::make_shared<Type_Enum>(value.
enm, deleter) :
throw "wrong type";};
67 S_Ident
ident() {
return LY_TYPE_IDENT == value_type ? std::make_shared<Ident>(value.
ident, deleter) :
throw "wrong type";};
111 Data_Node(S_Data_Node parent, S_Module module,
const char *name,
const char *val_str);
115 Data_Node(S_Data_Node parent, S_Module module,
const char *name, S_Data_Node value);
117 Data_Node(S_Data_Node parent, S_Module module,
const char *name, S_Xml_Elem value);
121 Data_Node(S_Context context,
const char *path, S_Data_Node value,
int options);
123 Data_Node(S_Context context,
const char *path, S_Xml_Elem value,
int options);
146 S_Data_Node parent() LY_NEW(node, parent, Data_Node);
154 S_Data_Node
dup(
int recursive);
158 S_Data_Node
dup_to_ctx(
int recursive, S_Context context);
160 int merge(S_Data_Node source,
int options);
162 int merge_to_ctx(S_Data_Node source,
int options, S_Context context);
164 int insert(S_Data_Node new_node);
180 int validate(
int options, S_Context var_arg);
182 int validate(
int options, S_Data_Node var_arg);
186 S_Difflist
diff(S_Data_Node second,
int options);
190 S_Data_Node
new_path(S_Context ctx, const
char *path, S_Data_Node value,
int options);
192 S_Data_Node
new_path(S_Context ctx, const
char *path, S_Xml_Elem value,
int options);
198 S_Attr
insert_attr(S_Module module, const
char *name, const
char *value);
206 std::vector<S_Data_Node>
tree_for();
208 std::vector<S_Data_Node>
tree_dfs();
248 S_Data_Node
child() {
return nullptr;};
280 S_Data_Node
child() {
return nullptr;};
295 Attr(
struct lyd_attr *attr, S_Deleter deleter =
nullptr);
303 const
char *
name() {
return attr->name;};
328 std::vector<S_Data_Node>
first();
330 std::vector<S_Data_Node>
second();
int insert(S_Data_Node new_node)
int insert_before(S_Data_Node new_node)
struct lyd_node * swig_node()
int schema_sort(int recursive)
int change_leaf(const char *val_str)
int merge_to_ctx(S_Data_Node source, int options, S_Context context)
int validate(int options, S_Context var_arg)
lyd_anydata_value value()
LY_DATA_TYPE value_type()
S_Data_Node create_new_Data_Node(struct lyd_node *node)
S_Data_Node dup(int recursive)
node's value representation
S_Data_Node first_sibling()
int merge(S_Data_Node source, int options)
Value(lyd_val value, LY_DATA_TYPE *value_type, uint8_t value_flags, struct lys_type *type, S_Deleter deleter)
LY_DATA_TYPE _PACKED value_type
Data_Node_Anydata(S_Data_Node derived)
Data_Node(struct lyd_node *node, S_Deleter deleter=nullptr)
class for wrapping lyd_val.
friend Data_Node_Leaf_List
S_Set find_path(const char *expr)
libyang representation of data trees.
Class implementation for libyang C header tree_schema.h.
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
std::vector< S_Data_Node > first()
LYD_ANYDATA_VALUETYPE value_type()
S_Attr insert_attr(S_Module module, const char *name, const char *value)
Attr(struct lyd_attr *attr, S_Deleter deleter=nullptr)
S_Data_Node dup_withsiblings(int recursive)
class for wrapping lyd_node_anydata.
std::vector< S_Data_Node > second()
S_Difflist diff(S_Data_Node second, int options)
Structure for data nodes defined as LYS_LEAF or LYS_LEAFLIST.
Difflist(struct lyd_difflist *diff, S_Deleter deleter)
classes for wrapping lyd_node.
class for wrapping lyd_difflist.
Structure for the result of lyd_diff(), describing differences between two data trees.
int validate_value(const char *value)
Data_Node_Leaf_List(S_Data_Node derived)
std::string print_mem(LYD_FORMAT format, int options)
class for wrapping lyd_node_leaf_list.
class for wrapping lyd_attr.
int insert_sibling(S_Data_Node new_node)
LY_DATA_TYPE value_type()
LYD_DIFFTYPE
list of possible types of differences in lyd_difflist
LY_DATA_TYPE
YANG built-in types.
struct lyd_node * C_lyd_node()
struct lys_type_info_dec64 dec64
std::vector< S_Data_Node > tree_dfs()
YANG type structure providing information from the schema.
virtual S_Data_Node child()
S_Data_Node new_path(S_Context ctx, const char *path, const char *value, LYD_ANYDATA_VALUETYPE value_type, int options)
Generic structure for a data node, directly applicable to the data nodes defined as LYS_CONTAINER...
std::vector< S_Data_Node > tree_for()
std::vector< S_Type_Bit > bit()
LYD_ANYDATA_VALUETYPE
List of possible value types stored in lyd_node_anydata.
int insert_after(S_Data_Node new_node)
Structure for data nodes defined as LYS_ANYDATA or LYS_ANYXML.
S_Data_Node dup_to_ctx(int recursive, S_Context context)
S_Set find_instance(S_Schema_Node schema)
struct lys_type_enum * enm