summaryrefslogtreecommitdiff
path: root/include/value.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-12-07 13:12:25 -0800
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-12-07 13:12:25 -0800
commit80c8a16fb145f7ed4867d31fad3c22318a1ce708 (patch)
treef7605cdb86d653efaac761363ed596dd6b2e0459 /include/value.h
parent964d6274b0eba38df43d77b87c44bd728d2f0fb5 (diff)
replaces tabs in source code with regular spaces, added example for working with global variables
Diffstat (limited to 'include/value.h')
-rw-r--r--include/value.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/include/value.h b/include/value.h
index b2ce89b..09392ad 100644
--- a/include/value.h
+++ b/include/value.h
@@ -264,7 +264,7 @@ public:
* Change the internal type of the variable
* @param Type
*/
- Value &setType(Type type);
+ virtual Value &setType(Type type);
/**
* Make a clone of the value with the same type
@@ -290,7 +290,7 @@ public:
bool isFloat() const { return type() == floatType; }
bool isObject() const { return type() == objectType; }
bool isArray() const { return type() == arrayType; }
- bool isCallable() const;
+ bool isCallable() const;
/**
* Retrieve the value as number
@@ -531,7 +531,7 @@ public:
/**
* Call the function in PHP
* We have ten variants of this function, depending on the number of parameters
- * This call operator is only useful when the variable represents a callable
+ * This call operator is only useful when the variable represents a callable
* @param name Name of the function
* @return Value
*/
@@ -548,13 +548,13 @@ public:
Value operator()(Value p0, Value p1, Value p2, Value p3, Value p4, Value p5, Value p6, Value p7, Value p8, Value p9);
private:
- /**
- * Call function with a number of parameters
- * @param argc Number of parameters
- * @param argv The parameters
- * @return Value
- */
- Value exec(int argc, struct _zval_struct ***params);
+ /**
+ * Call function with a number of parameters
+ * @param argc Number of parameters
+ * @param argv The parameters
+ * @return Value
+ */
+ Value exec(int argc, struct _zval_struct ***params);
protected:
/**
@@ -564,6 +564,14 @@ protected:
struct _zval_struct *_val;
/**
+ * Validate the value
+ * This is a overridable function that is implemented in base classes to
+ * ensure that a value of certain type stays valid
+ * @return Value
+ */
+ virtual Value &validate() { return *this; }
+
+ /**
* The Globals and Member classes can access the zval directly
*/
friend class Globals;