summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:10:16 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:10:16 +0100
commit81861258bef606bcdf14d170fb73cd06e25e5ebe (patch)
tree7b9027d8d461046ee982e059da08d54f4664f4ee /include
parentdd3422f6ed454d06e6091ad5023da7fc294595b8 (diff)
deal with magic methods and magic interfaces that throw exceptions
Diffstat (limited to 'include')
-rw-r--r--include/exception.h10
-rw-r--r--include/value.h11
2 files changed, 21 insertions, 0 deletions
diff --git a/include/exception.h b/include/exception.h
index 5bcc26a..8475925 100644
--- a/include/exception.h
+++ b/include/exception.h
@@ -54,6 +54,16 @@ public:
{
return _message;
}
+
+ /**
+ * Process the exception
+ *
+ * This method is called only from withing the PHP-CPP library,
+ * and will turn the exception into a PHP exception
+ *
+ * @internal
+ */
+ virtual void process();
};
/**
diff --git a/include/value.h b/include/value.h
index 2ffbd7c..f2850c9 100644
--- a/include/value.h
+++ b/include/value.h
@@ -308,6 +308,17 @@ public:
Value operator%(double value);
/**
+ * Comparison operators for hardcoded strings
+ * @param value
+ */
+ bool operator==(const char *value) const { return stringValue() == value; }
+ bool operator!=(const char *value) const { return stringValue() != value; }
+ bool operator<=(const char *value) const { return stringValue() <= value; }
+ bool operator>=(const char *value) const { return stringValue() >= value; }
+ bool operator< (const char *value) const { return stringValue() < value; }
+ bool operator> (const char *value) const { return stringValue() > value; }
+
+ /**
* Comparison operators
* @param value
*/