diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-02-21 16:59:54 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-02-21 16:59:54 +0100 |
commit | e1f97c494ae31b9d67e85c6b17a18bb925bc2989 (patch) | |
tree | f7c240f082aad70f35de024bdc229504a0cc5f0a /include | |
parent | 9889100041bf14d8bc1b97f1cab4070de36e3e8f (diff) |
initial implementation of the Php::dl() function
Diffstat (limited to 'include')
-rw-r--r-- | include/call.h | 18 | ||||
-rw-r--r-- | include/classbase.h | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/include/call.h b/include/call.h index d807190..53030d2 100644 --- a/include/call.h +++ b/include/call.h @@ -27,17 +27,25 @@ extern bool define(const std::string &name, const Value &value); extern bool defined(const char *constant); extern bool defined(const char *constant, size_t size); extern bool defined(const std::string &constant); -extern Value eval(const std::string &phpCode); -extern Value include(const std::string &filename); -extern Value include_once(const std::string &filename); +extern bool dl(const char *filename); +inline bool dl(const std::string &filename) { return dl(filename.c_str()); } +inline bool dl(const Value &filename) { return dl(filename.rawValue()); } +extern Value eval(const char *phpCode); +inline Value eval(const std::string &phpCode) { return eval(phpCode.c_str()); } +extern Value include(const char *filename); +inline Value include(const std::string &filename) { return include(filename.c_str()); } +extern Value include_once(const char *filename); +inline Value include_once(const std::string &filename) { return include_once(filename.c_str()); } 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.derivedFrom(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); } -extern Value require(const std::string &filename); -extern Value require_once(const std::string &filename); +extern Value require(const char *filename); +inline Value require(const std::string &filename) { return require(filename.c_str()); } +extern Value require_once(const char *filename); +inline Value require_once(const std::string &filename) { return require_once(filename.c_str()); } /** * Call a function in PHP diff --git a/include/classbase.h b/include/classbase.h index f594f75..9e53a62 100644 --- a/include/classbase.h +++ b/include/classbase.h @@ -96,7 +96,7 @@ public: * Construct a new instance of the object, or to clone the object * @return Base */ - virtual Base* construct() const { return nullptr; } + virtual Base *construct() const { return nullptr; } virtual Base *clone(Base *orig) const { return nullptr; } /** |