diff options
author | Jonathan Beck | 2009-10-16 22:26:13 +0200 |
---|---|---|
committer | Jonathan Beck | 2009-10-16 22:26:13 +0200 |
commit | 32be8ec384bfd78e189d3de6609e50cf4dd072a2 (patch) | |
tree | ac7edad0f19be2a31efaaaaa3acd477dd2f3c233 /src/Integer.cpp | |
parent | 8aeef4dd2331445fea8a7a40466b19973e9d09c4 (diff) | |
download | libplist-32be8ec384bfd78e189d3de6609e50cf4dd072a2.tar.gz libplist-32be8ec384bfd78e189d3de6609e50cf4dd072a2.tar.bz2 |
Fix Node lifecycle and change argument as reference to const reference.
Diffstat (limited to 'src/Integer.cpp')
-rw-r--r-- | src/Integer.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Integer.cpp b/src/Integer.cpp index 2a7429a..cf1ad33 100644 --- a/src/Integer.cpp +++ b/src/Integer.cpp @@ -32,6 +32,17 @@ Integer::Integer(plist_t node) : Node(node) { } +Integer::Integer(PList::Integer& i) : Node(PLIST_UINT) +{ + plist_set_uint_val(_node, i.GetValue()); +} + +Integer& Integer::operator=(PList::Integer& i) +{ + plist_free(_node); + _node = plist_copy(i.GetPlist()); +} + Integer::Integer(uint64_t i) : Node(PLIST_UINT) { plist_set_uint_val(_node, i); @@ -41,6 +52,11 @@ Integer::~Integer() { } +Node* Integer::Clone() +{ + return new Integer(*this); +} + void Integer::SetValue(uint64_t i) { plist_set_uint_val(_node, i); |