diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-06-08 18:24:49 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-06-08 19:39:31 +0200 |
commit | 75d85549c6d2a5284593e20c21d61fc5d6200bca (patch) | |
tree | b5077e272f238b47af9530f9b2fac2e69839d063 /src/nodetree.h | |
parent | 195bf2f6a7d7268a88338ae8fd3a30fdb5196300 (diff) |
Add 'insert before id' to create and move commands.
Diffstat (limited to 'src/nodetree.h')
-rw-r--r-- | src/nodetree.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nodetree.h b/src/nodetree.h index 8052389..2ab9ec7 100644 --- a/src/nodetree.h +++ b/src/nodetree.h @@ -49,16 +49,17 @@ public: class NodeTree { - friend class XmlParser; public: NodeTree(); ~NodeTree(); nodeid_t createId(); - NodeIdList insertAsChild(nodeid_t parentid, nodeid_t id, node_t data) throw (std::exception); + NodeIdList insertAsChild(nodeid_t parentid, nodeid_t id, node_t data, + nodeid_t insertBeforeId) throw (std::exception); NodeIdList remove(nodeid_t id) throw (std::exception); - NodeIdList move(nodeid_t id, nodeid_t newParentId) throw (std::exception); + NodeIdList move(nodeid_t id, nodeid_t newParentId, + nodeid_t insertBeforeId) throw (std::exception); NodeIdList updateData(nodeid_t id, const std::string &name, const std::string &value) throw (std::exception); node_t data(nodeid_t id) throw (std::exception); @@ -70,13 +71,14 @@ public: void toStdOut(); std::string toXML(); - void fromXML(std::string xml); + void fromXML(const std::string& xml); nodeid_t nextid; private: + friend class XmlParser; Node* createNode(nodeid_t id); - void insertChild(Node* parent, Node* child); + void insertChild(Node* parent, Node* child, nodeid_t insertBeforeId); Node* root; std::map<int, Node*> id2node; |