From 75d85549c6d2a5284593e20c21d61fc5d6200bca Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 8 Jun 2020 18:24:49 +0200 Subject: Add 'insert before id' to create and move commands. --- src/nodetree.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/nodetree.h') 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 id2node; -- cgit v1.2.3