summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-23 21:15:26 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-23 21:15:26 +0100
commit41396949abf0bdc861db0cb477056306e47facfb (patch)
tree809976cd83074da122cf2e5d85e66ae3a276e3e2
parent68441d448e377f9a61af5c29c793922fff0d9328 (diff)
added echo() function requested in issue #51
-rw-r--r--include/call.h2
-rw-r--r--phpcpp.h2
-rw-r--r--src/includes.h2
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()); }
diff --git a/phpcpp.h b/phpcpp.h
index 028636e..a2dca1d 100644
--- a/phpcpp.h
+++ b/phpcpp.h
@@ -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"
/**