mirror of
https://github.com/libimobiledevice/libplist
synced 2026-06-08 15:29:34 +00:00
Fix Node lifecycle and change argument as reference to const reference.
This commit is contained in:
@@ -32,6 +32,17 @@ Boolean::Boolean(plist_t node) : Node(node)
|
||||
{
|
||||
}
|
||||
|
||||
Boolean::Boolean(PList::Boolean& b) : Node(PLIST_BOOLEAN)
|
||||
{
|
||||
plist_set_bool_val(_node, b.GetValue());
|
||||
}
|
||||
|
||||
Boolean& Boolean::operator=(PList::Boolean& b)
|
||||
{
|
||||
plist_free(_node);
|
||||
_node = plist_copy(b.GetPlist());
|
||||
}
|
||||
|
||||
Boolean::Boolean(bool b) : Node(PLIST_BOOLEAN)
|
||||
{
|
||||
plist_set_bool_val(_node, b);
|
||||
@@ -41,6 +52,11 @@ Boolean::~Boolean()
|
||||
{
|
||||
}
|
||||
|
||||
Node* Boolean::Clone()
|
||||
{
|
||||
return new Boolean(*this);
|
||||
}
|
||||
|
||||
void Boolean::SetValue(bool b)
|
||||
{
|
||||
plist_set_bool_val(_node, b);
|
||||
|
||||
Reference in New Issue
Block a user