20#include "Internal.hpp"
51S_Xml_Elem
Xml_Elem::parent() {
return elem->parent ? std::make_shared<Xml_Elem>(context, elem->parent, deleter) :
nullptr;}
53S_Xml_Elem
Xml_Elem::
child() {
return elem->child ? std::make_shared<Xml_Elem>(context, elem->child, deleter) :
nullptr;}
54S_Xml_Elem
Xml_Elem::next() {
return elem->next ? std::make_shared<Xml_Elem>(context, elem->next, deleter) :
nullptr;}
55S_Xml_Elem
Xml_Elem::prev() {
return elem->prev ? std::make_shared<Xml_Elem>(context, elem->prev, deleter) :
nullptr;}
62 return elem->ns ? std::make_shared<Xml_Ns>((
struct lyxml_ns *)
ns, deleter) :
nullptr;
72 std::string s_data = data;
78 std::vector<S_Xml_Elem> s_vector;
82 s_vector.push_back(std::make_shared<Xml_Elem>(context, elem, deleter));
88 std::vector<S_Xml_Elem> s_vector;
92 s_vector.push_back(std::make_shared<Xml_Elem>(context, elem, deleter));
Class implementation for libyang C header xml.h.
Xml_Attr(struct lyxml_attr *attr, S_Deleter deleter)
Xml_Elem(S_Context context, struct lyxml_elem *elem, S_Deleter deleter)
std::vector< S_Xml_Elem > tree_for()
const char * get_attr(const char *name, const char *ns=nullptr)
std::vector< S_Xml_Elem > tree_dfs()
S_Xml_Ns get_ns(const char *prefix)
std::string print_mem(int options)
class for wrapping lyxml_ns.
Xml_Ns(const struct lyxml_ns *ns, S_Deleter deleter)
#define LY_TREE_DFS_BEGIN(START, NEXT, ELEM)
Macro to iterate via all elements in a tree. This is the opening part to the LY_TREE_DFS_END - they a...
#define LY_TREE_FOR(START, ELEM)
Macro to iterate via all sibling elements without affecting the list itself.
int lyxml_print_mem(char **strp, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
const struct lyxml_ns * lyxml_get_ns(const struct lyxml_elem *elem, const char *prefix)
Get namespace definition of the given prefix in context of the specified element.
const char * lyxml_get_attr(const struct lyxml_elem *elem, const char *name, const char *ns)
Get value of the attribute in the specified element.
Element's attribute definition.
Structure describing an element in an XML tree.
The main libyang public header.
#define LY_TREE_DFS_END(START, NEXT, ELEM)
Public API of libyang XML parser.