From 59cfe935248918c1151b300eb19496b76ed579a9 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Tue, 4 Mar 2014 09:27:01 +0100 Subject: removed forcedvalue and implemented array and object directly because now it is easier to finetune these classes, removed the Value::validate() method because it does not seem to be necessary, Object constructor now also accepts Php::Value objects that hold a string, to instantiate the described class --- src/includes.h | 2 +- src/value.cpp | 29 ++++++++++------------------- 2 files changed, 11 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/includes.h b/src/includes.h index 072fab2..60783eb 100644 --- a/src/includes.h +++ b/src/includes.h @@ -46,7 +46,7 @@ #include "../include/exception.h" #include "../include/type.h" #include "../include/value.h" -#include "../include/forcedvalue.h" +#include "../include/array.h" #include "../include/object.h" #include "../include/hiddenpointer.h" #include "../include/globals.h" diff --git a/src/value.cpp b/src/value.cpp index 8047dee..13c4d88 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -309,9 +309,6 @@ Value &Value::operator=(Value &&value) // the other object is no longer valid value._val = nullptr; } - - // update the object - return validate(); } /** @@ -357,7 +354,7 @@ Value &Value::operator=(const Value &value) } // update the object - return validate(); + return *this; } @@ -378,7 +375,7 @@ Value &Value::operator=(std::nullptr_t value) ZVAL_NULL(_val); // update the object - return validate(); + return *this; } /** @@ -398,7 +395,7 @@ Value &Value::operator=(int16_t value) ZVAL_LONG(_val, value); // update the object - return validate(); + return *this; } /** @@ -418,7 +415,7 @@ Value &Value::operator=(int32_t value) ZVAL_LONG(_val, value); // update the object - return validate(); + return *this; } /** @@ -438,7 +435,7 @@ Value &Value::operator=(int64_t value) ZVAL_LONG(_val, value); // update the object - return validate(); + return *this; } /** @@ -458,7 +455,7 @@ Value &Value::operator=(bool value) ZVAL_BOOL(_val, value); // update the object - return validate(); + return *this; } /** @@ -478,7 +475,7 @@ Value &Value::operator=(char value) ZVAL_STRINGL(_val, &value, 1, 1); // update the object - return validate(); + return *this; } /** @@ -498,7 +495,7 @@ Value &Value::operator=(const std::string &value) ZVAL_STRINGL(_val, value.c_str(), value.size(), 1); // update the object - return validate(); + return *this; } /** @@ -518,7 +515,7 @@ Value &Value::operator=(const char *value) ZVAL_STRING(_val, value, 1); // update the object - return validate(); + return *this; } /** @@ -538,7 +535,7 @@ Value &Value::operator=(double value) ZVAL_DOUBLE(_val, value); // update the object - return validate(); + return *this; } /** @@ -1499,9 +1496,6 @@ const Value &Value::set(int index, const Value &value) // the variable has one more reference (the array entry) Z_ADDREF_P(value._val); - // object should stay valid - validate(); - // done return value; } @@ -1552,9 +1546,6 @@ const Value &Value::set(const char *key, int size, const Value &value) Z_ADDREF_P(value._val); } - // object should stay valid - validate(); - // done return value; } -- cgit v1.2.3