summaryrefslogtreecommitdiff
path: root/include/call.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-07-26 17:00:10 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-07-26 17:00:10 +0200
commit3f1d5ca94f721cf7feff0fc9cb05a5c1b6d39873 (patch)
treefe166c06985a968e255cc9ca1687c24704c69c42 /include/call.h
parent542e8a44708668001e59cf08b61c642da5080825 (diff)
added Value::subclassOf(), and implemented Php::is_a() and Php::is_subclass_of()
Diffstat (limited to 'include/call.h')
-rw-r--r--include/call.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/call.h b/include/call.h
index e1bb12d..dff815c 100644
--- a/include/call.h
+++ b/include/call.h
@@ -19,6 +19,13 @@ extern bool class_exists(const char *classname, size_t size, bool autoload = tr
inline bool class_exists(const char *classname, bool autoload = true) { return class_exists(classname, strlen(classname), autoload); }
inline bool class_exists(const std::string &classname, bool autoload = true) { return class_exists(classname.c_str(), classname.size(), autoload); }
extern Value eval(const std::string &phpCode);
+inline bool is_a(const Value &obj, const char *classname, size_t size, bool allow_string = false) { return obj.instanceOf(classname, size, allow_string); }
+inline bool is_a(const Value &obj, const char *classname, bool allow_string = false) { return is_a(obj, classname, strlen(classname), allow_string); }
+inline bool is_a(const Value &obj, const std::string &classname, bool allow_string = false) { return is_a(obj, classname.c_str(), classname.size(), allow_string); }
+inline bool is_subclass_of(const Value &obj, const char *classname, size_t size, bool allow_string = true) { return obj.subclassOf(classname, size, allow_string); }
+inline bool is_subclass_of(const Value &obj, const char *classname, bool allow_string = true) { return is_subclass_of(obj, classname, strlen(classname), allow_string); }
+inline bool is_subclass_of(const Value &obj, const std::string &classname, bool allow_string = true) { return is_subclass_of(obj, classname.c_str(), classname.size(), allow_string); }
+
/**
* Call a function in PHP