14 BEGIN_NAMESPACE_SERIALIZATION
20 using DxNodePtr = std::shared_ptr<DxNode>;
21 using DxNodeWPtr = std::weak_ptr<DxNode>;
22 using DxNodeListPtr = std::shared_ptr<DxNodeList>;
23 using DxNodeExtInfoPtr = std::shared_ptr<DxNodeExtInfo>;
30 std::vector<DxNodePtr> list;
38 DxNodeListPtr children =
nullptr;
39 DxNodeListPtr attributes =
nullptr;
104 static DxNodePtr
dxNodeCreate(
const std::string& nodeName,
const std::string&
value);
179 static DxNodePtr
dxNodeFindChildNode(
const DxNodePtr& node,
const std::string& childNodeName);
202 static DxNodePtr
dxNodeGetAttribute(
const DxNodePtr& node,
const size_t attributeIndex);
251 static DxNodePtr
dxNodeClone(
const DxNodePtr& sourceNode);
255 static void BuildTree(
const DxNodePtr& sourceNode,
const DxNodePtr& destinationNode);
256 static void dxNodeListRemove(
const DxNodeListPtr& nodeList, DxNodePtr& node);
257 static void dxNodeListClear(DxNodeListPtr& nodeList);
258 static void dxNodeListAdd(
const DxNodeListPtr& nodeList,
const DxNodePtr& node);
259 static DxNodePtr dxNodeListFindNode(
const DxNodeListPtr& nodeList,
const std::string& nodeName);
260 static void dxNodeListDestroy(DxNodeListPtr& nodeList);
261 static void dxNodeListCreate(DxNodeListPtr& nodeList);
265 END_NAMESPACE_SERIALIZATION
std::string value
Value of a node.
Definition: dx_node.h:57
static void dxNodeAddAttributeNode(const DxNodePtr &node, const DxNodePtr &attributeNode)
Function adds a given attribute to a given node.
DxNodeExtInfo struct that contains shared pointers to node child and attribute elements.
Definition: dx_node.h:36
static void dxNodeClearAttributeNodes(const DxNodePtr &node)
Function clears all attribute elements of a given node.
static DxNodePtr dxNodeFindChildNode(const DxNodePtr &node, const std::string &childNodeName)
Function returns a shared pointer to a child node with a given name.
static size_t dxNodeGetChildCount(const DxNodePtr &node)
Function returns a number of child elements of a given node.
static void dxNodeClearChildNodes(const DxNodePtr &node)
Function clears all children elements of a given node.
size_t childIndex
Child index of a node.
Definition: dx_node.h:72
static void dxNodeAddChildNode(const DxNodePtr &node, const DxNodePtr &childNode)
Function adds a given child to a given node.
static DxNodePtr dxNodeClone(const DxNodePtr &sourceNode)
Function creates and returns a copy of a given node.
XmlException class that inherits from std::exception and is used for exception handling in xml serial...
DxNode(const std::string &name, const std::string &value="")
Constructor that creates an instance od a DxNode class with a given name.
Definition: dx_node.h:87
static void dxNodeRemoveChild(const DxNodePtr &node, DxNodePtr &childNode)
Function removes a given child from a given node.
DxNode class defines an internal xml node and implements functions for creating, modifying and removi...
Definition: dx_node.h:45
DxNodeWPtr parent
Weak pointer to a parent node.
Definition: dx_node.h:67
static void dxNodeSetValue(const DxNodePtr &node, const std::string &value)
Function sets a value to a node.
DxNode()
Default constructor that creates an instance od a DxNode class with default values.
Definition: dx_node.h:77
static DxNodePtr dxNodeGetNextSibling(const DxNodePtr &node)
Function returns a sibling of a given node (next child of a given node parent).
static DxNodePtr dxNodeFindAttributeNode(const DxNodePtr &node, const std::string &attributeNodeName)
Function returns a shared pointer to an attribute node with a given name.
static void dxNodeRemoveAttributeNode(const DxNodePtr &node, DxNodePtr &attributeNode)
Function removes a given attribute from a given node.
DxNodeExtInfoPtr extInfo
Shared pointer to a DxNodeExtInfo that contains pointers to child and attribute elements.
Definition: dx_node.h:62
static DxNodePtr dxNodeGetChild(const DxNodePtr &node, const size_t childIndex)
Function returns a child with a given index.
static DxNodePtr dxNodeCreate(const std::string &nodeName, const std::string &value)
Function creates and returns a new node with a given name and value.
static void dxNodeMakeChildNodes(const DxNodePtr &node)
Function creates a new pointer to child elements and assigns it to a given node.
DxNodeList struct that contains a DxNode vector.
Definition: dx_node.h:28
static void dxNodeDestroy(DxNodePtr &node)
Function recursively clears all child nodes and sets node pointer to nullptr.
std::string name
Name of a node.
Definition: dx_node.h:52
static DxNodePtr dxNodeGetAttribute(const DxNodePtr &node, const size_t attributeIndex)
Function returns an attribute with a given index.
static size_t dxNodeGetAttributeCount(const DxNodePtr &node)
Function returns a number of attribute elements of a given node.