summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-07-23 11:20:18 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-07-23 11:20:18 +0200
commitdb7cb1d6e44470b820fd5f4f4650a8c4ce392ab6 (patch)
treeb0b907ac6367c4e13d8d894636bf5efd3158254e
parentf66ec20be218343766db3441fd20ff979d50240e (diff)
It now is possible to assign Php::Value["whatever"] results directly to new Php::Value objects
-rw-r--r--include/value.h2
-rw-r--r--zend/value.cpp22
2 files changed, 24 insertions, 0 deletions
diff --git a/include/value.h b/include/value.h
index e61750b..3aad995 100644
--- a/include/value.h
+++ b/include/value.h
@@ -164,6 +164,8 @@ public:
Value &operator=(const std::string &value);
Value &operator=(const char *value);
Value &operator=(double value);
+ Value &operator=(const HashMember<std::string> &value);
+ Value &operator=(const HashMember<int> &value);
/**
* Add a value to the object
diff --git a/zend/value.cpp b/zend/value.cpp
index 7c95c06..5354904 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -689,6 +689,28 @@ Value &Value::operator=(double value)
}
/**
+ * Assignment operator
+ * @param value
+ * @return Value
+ */
+Value &Value::operator=(const HashMember<std::string> &value)
+{
+ // assign value object
+ return operator=(value.value());
+}
+
+/**
+ * Assignment operator
+ * @param value
+ * @return Value
+ */
+Value &Value::operator=(const HashMember<int> &value)
+{
+ // assign value object
+ return operator=(value.value());
+}
+
+/**
* Add a value to the object
* @param value
* @return Value