From e1f97c494ae31b9d67e85c6b17a18bb925bc2989 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sat, 21 Feb 2015 16:59:54 +0100 Subject: initial implementation of the Php::dl() function --- include/call.h | 18 +++++++++++++----- include/classbase.h | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'include') 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; } /** -- cgit v1.2.3