summaryrefslogtreecommitdiff
path: root/zend/parametersimpl.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:53:24 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:53:24 +0200
commit35fd3ccbeb4def71b4d8a59dfbb5c31201b099b9 (patch)
tree915223360aed4743aa6127fde4836aa413a260e5 /zend/parametersimpl.h
parentda4710512865e6816585ac4ab8edab2fa125e2d8 (diff)
renamed src directory to zend directory, disabled TSRM debug code
Diffstat (limited to 'zend/parametersimpl.h')
-rw-r--r--zend/parametersimpl.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/zend/parametersimpl.h b/zend/parametersimpl.h
new file mode 100644
index 0000000..fd14238
--- /dev/null
+++ b/zend/parametersimpl.h
@@ -0,0 +1,53 @@
+/**
+ * ParametersImpl.h
+ *
+ * Extended parameters class that can be instantiated
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class ParametersImpl : public Parameters
+{
+public:
+ /**
+ * Constructor
+ * @param this_ptr Pointer to the object
+ * @param argc Number of arguments
+ * @param tsrm_ls
+ */
+ ParametersImpl(zval *this_ptr, int argc TSRMLS_DC) : Parameters(this_ptr ? ObjectImpl::find(this_ptr TSRMLS_CC)->object() : nullptr)
+ {
+ // reserve plenty of space
+ reserve(argc);
+
+ // loop through the arguments
+ for (int i=0; i<argc; i++)
+ {
+ // get the argument
+ zval **arg = (zval **) (zend_vm_stack_top(TSRMLS_C) - 1 - (argc-i));
+
+ // append value
+ push_back(Value(*arg));
+ }
+ }
+
+ /**
+ * Destructor
+ */
+ virtual ~ParametersImpl() {}
+};
+
+/**
+ * End of namespace
+ */
+}
+