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/Real.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/Real.cpp')
-rw-r--r-- | src/Real.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Real.cpp b/src/Real.cpp index 5416887..e527f6d 100644 --- a/src/Real.cpp +++ b/src/Real.cpp @@ -32,6 +32,17 @@ Real::Real(plist_t node) : Node(node) { } +Real::Real(PList::Real& d) : Node(PLIST_UINT) +{ + plist_set_real_val(_node, d.GetValue()); +} + +Real& Real::operator=(PList::Real& d) +{ + plist_free(_node); + _node = plist_copy(d.GetPlist()); +} + Real::Real(double d) : Node(PLIST_REAL) { plist_set_real_val(_node, d); @@ -41,6 +52,11 @@ Real::~Real() { } +Node* Real::Clone() +{ + return new Real(*this); +} + void Real::SetValue(double d) { plist_set_real_val(_node, d); |