#include <cstdlib>
#include <plist/Array.h>
#include <plist/Boolean.h>
namespace PList {
Boolean::Boolean(Node *parent) : Node(PLIST_BOOLEAN, parent) {}
Boolean::Boolean(plist_t node, Node *parent) : Node(node, parent) {}
Boolean::Boolean(const PList::Boolean &b) : Node(PLIST_BOOLEAN) {
plist_set_bool_val(_node, b.GetValue());
}
Boolean &Boolean::operator=(const PList::Boolean &b) {
plist_free(_node);
_node = plist_copy(b.GetPlist());
return *this;
}
Boolean::Boolean(bool b) : Node(PLIST_BOOLEAN) { plist_set_bool_val(_node, b); }
Boolean::~Boolean() {}
Node *Boolean::Clone() const { return new Boolean(*this); }
void Boolean::SetValue(bool b) { plist_set_bool_val(_node, b); }
bool Boolean::GetValue() const {
uint8_t b = 0;
plist_get_bool_val(_node, &b);
return b != 0;
}
}