diff options
author | Jonathan Beck | 2009-10-26 18:41:15 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-10-26 18:41:15 +0100 |
commit | c1363bea107b15bdc10ce80671747be891661889 (patch) | |
tree | 1a8ce452eb6c1110ea0cd88dec155e99bfe7b69b /src/Node.cpp | |
parent | bef50c0873aad5d8cd516428828e79fc05a43913 (diff) | |
download | libplist-c1363bea107b15bdc10ce80671747be891661889.tar.gz libplist-c1363bea107b15bdc10ce80671747be891661889.tar.bz2 |
Add Set/Get Parent and a helper to create a Node from a plist_t.
Diffstat (limited to 'src/Node.cpp')
-rw-r--r-- | src/Node.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Node.cpp b/src/Node.cpp index ace1990..4497bb1 100644 --- a/src/Node.cpp +++ b/src/Node.cpp @@ -24,15 +24,15 @@ namespace PList { -Node::Node() +Node::Node(Node* parent) : _parent(parent) { } -Node::Node(plist_t node) : _node(node) +Node::Node(plist_t node, Node* parent) : _node(node), _parent(parent) { } -Node::Node(plist_type type) +Node::Node(plist_type type, Node* parent) : _parent(parent) { _node = NULL; @@ -72,6 +72,7 @@ Node::~Node() { plist_free(_node); _node = NULL; + _parent = NULL; } plist_type Node::GetType() @@ -86,4 +87,15 @@ plist_t Node::GetPlist() { return _node; } + +Node* Node::GetParent() +{ + return _parent; +} + +void Node::SetParent(Node* parent) +{ + _parent = parent; +} + }; |