summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-01-16 07:47:18 -0800
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-01-16 07:47:18 -0800
commit6a49c12782e6786257804a1a0a84456cb85bb3a4 (patch)
tree1f23ef0cc37fb4746cec6f2190d487f157b58d11 /src
parent22923e12267ce18197b73c2dfae3eb626167fd9d (diff)
the origexception class has been moved to the src directory, because it is a private class only used inside the library
Diffstat (limited to 'src')
-rw-r--r--src/includes.h2
-rw-r--r--src/origexception.h62
2 files changed, 63 insertions, 1 deletions
diff --git a/src/includes.h b/src/includes.h
index 501a71d..95f517e 100644
--- a/src/includes.h
+++ b/src/includes.h
@@ -58,7 +58,6 @@
#include "../include/classinfo.h"
#include "../include/extension.h"
#include "../include/exception.h"
-#include "../include/origexception.h"
#include "../include/init.h"
/**
@@ -75,6 +74,7 @@
#include "doublemember.h"
#include "methodmember.h"
#include "arithmetic.h"
+#include "origexception.h"
#ifndef ZVAL_COPY_VALUE
#define ZVAL_COPY_VALUE(z, v) \
diff --git a/src/origexception.h b/src/origexception.h
new file mode 100644
index 0000000..ca59e7f
--- /dev/null
+++ b/src/origexception.h
@@ -0,0 +1,62 @@
+/**
+ * OrigException.h
+ *
+ * Class that wraps around an exception that was thrown by PHP code,
+ * and that could - but not necessarily has to - be caught by C++
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class OrigException : public Value, public Exception
+{
+private:
+ /**
+ * Has the exception been restored by the C++ code so that it can be dealt by PHP?
+ * @var boolean
+ */
+ bool _restored;
+
+public:
+ /**
+ * Constructor
+ * @param zval
+ */
+ OrigException(struct _zval_struct *zval);
+
+ /**
+ * Copy constructor
+ * @param exception
+ */
+ OrigException(const OrigException &exception);
+
+ /**
+ * Move constructor
+ * @param exception
+ */
+ OrigException(OrigException &&exception);
+
+ /**
+ * Destructor
+ */
+ virtual ~OrigException() throw();
+
+ /**
+ * Restore the exception - because the exception was not handled by C++ code
+ * @internal
+ */
+ void restore();
+};
+
+/**
+ * End of namespace
+ */
+}