summaryrefslogtreecommitdiff
path: root/include/exception.h
diff options
context:
space:
mode:
authorJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 16:50:12 +0100
committerJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 16:50:12 +0100
commitb6665b72996d23522d8a277cf4acc3d46e5e11fa (patch)
tree816b5225806f60a043e35faa366f5becf9ca2f9f /include/exception.h
parent9185842b1d2fd352f6d71a46d2017fa25cc3c6a7 (diff)
Added a very basic exception class, and added an exception example
Diffstat (limited to 'include/exception.h')
-rw-r--r--include/exception.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/exception.h b/include/exception.h
new file mode 100644
index 0000000..ea328fe
--- /dev/null
+++ b/include/exception.h
@@ -0,0 +1,54 @@
+/**
+ * Exception.h
+ * Implementation of Php Exceptions.
+ *
+ * @author Jasper van Eck <jasper.vaneck@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class Exception
+{
+private:
+ /**
+ * The exception message
+ * @var char*
+ */
+ char* _message;
+
+public:
+ /**
+ * Constructor
+ * @param string The exception message.
+ */
+ Exception(char* message) throw()
+ {
+ _message = message;
+ }
+
+ /**
+ * Destructor
+ */
+ ~Exception() throw()
+ {
+ }
+
+ /**
+ * Returns the message of the exception.
+ * @return std::string
+ */
+ char* getMessage() const throw()
+ {
+ return _message;
+ }
+
+};
+
+}