diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-23 21:15:26 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-23 21:15:26 +0100 |
commit | 41396949abf0bdc861db0cb477056306e47facfb (patch) | |
tree | 809976cd83074da122cf2e5d85e66ae3a276e3e2 | |
parent | 68441d448e377f9a61af5c29c793922fff0d9328 (diff) |
added echo() function requested in issue #51
-rw-r--r-- | include/call.h | 2 | ||||
-rw-r--r-- | phpcpp.h | 2 | ||||
-rw-r--r-- | src/includes.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/include/call.h b/include/call.h index d71c077..0ef6353 100644 --- a/include/call.h +++ b/include/call.h @@ -46,6 +46,8 @@ Value call(const char *name, Params&&... params) */ inline Value array_keys(const Value &value) { return call("array_keys", value); } inline Value array_values(const Value &value) { return call("array_values", value); } +inline Value echo(const char *input) { out << input; return nullptr; } +inline Value echo(const std::string &input) { out << input; return nullptr; } inline Value empty(const Value &value) { return value.isNull() || !value.boolValue(); } inline Value empty(const HashMember<std::string> &member) { return !member.exists() || empty(member.value()); } inline Value empty(const HashMember<int> &member) { return !member.exists() || empty(member.value()); } @@ -26,6 +26,7 @@ * Include all headers files that are related to this library */ #include <phpcpp/exception.h> +#include <phpcpp/streams.h> #include <phpcpp/type.h> #include <phpcpp/value.h> #include <phpcpp/valueiterator.h> @@ -54,7 +55,6 @@ #include <phpcpp/namespace.h> #include <phpcpp/extension.h> #include <phpcpp/call.h> -#include <phpcpp/streams.h> /** * Macro to export a function diff --git a/src/includes.h b/src/includes.h index 2f5cc1c..97ede79 100644 --- a/src/includes.h +++ b/src/includes.h @@ -45,6 +45,7 @@ * Include other files from this library */ #include "../include/exception.h" +#include "../include/streams.h" #include "../include/type.h" #include "../include/value.h" #include "../include/valueiterator.h" @@ -73,7 +74,6 @@ #include "../include/namespace.h" #include "../include/extension.h" #include "../include/call.h" -#include "../include/streams.h" #include "../include/init.h" /** |