1
This commit is contained in:
parent
15913ad559
commit
71253c2b72
@ -20,8 +20,29 @@ namespace a8
|
||||
|
||||
XObject::XObject(const a8::XObject& v)
|
||||
{
|
||||
type_ = XOT_SIMPLE;
|
||||
value_.x_value = new a8::XValue();
|
||||
switch (v.type_) {
|
||||
case XOT_SIMPLE:
|
||||
{
|
||||
value_.x_value = new a8::XValue();
|
||||
}
|
||||
break;
|
||||
case XOT_ARRAY:
|
||||
{
|
||||
value_.array_value = new std::vector<std::shared_ptr<a8::XObject>>();
|
||||
}
|
||||
break;
|
||||
case XOT_OBJECT:
|
||||
{
|
||||
value_.object_value = new std::map<std::string, std::shared_ptr<a8::XObject>>();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
abort();
|
||||
}
|
||||
break;
|
||||
}
|
||||
type_ = v.type_;
|
||||
*this = v;
|
||||
}
|
||||
|
||||
@ -231,8 +252,12 @@ namespace a8
|
||||
{
|
||||
if (!value_.x_value) {
|
||||
value_.x_value = new a8::XValue();
|
||||
} else {
|
||||
*value_.x_value = a8::XValue();
|
||||
}
|
||||
if (obj.value_.x_value) {
|
||||
*value_.x_value = *obj.value_.x_value;
|
||||
}
|
||||
*value_.x_value = *obj.value_.x_value;
|
||||
}
|
||||
break;
|
||||
case XOT_ARRAY:
|
||||
|
Loading…
x
Reference in New Issue
Block a user