summaryrefslogtreecommitdiff
path: root/include/cppunit/Exception.h
diff options
context:
space:
mode:
authorBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-14 21:37:31 +0000
committerBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-14 21:37:31 +0000
commitfb5695f7ca74f6557bdff1ceff009628ac3adc4a (patch)
tree8e6c05a5db8ef1c3037a10f579c31f0eb38a087e /include/cppunit/Exception.h
parentf5f2b1d2761b1d81c042d51619182c7951fd23aa (diff)
downloadcppunit-fb5695f7ca74f6557bdff1ceff009628ac3adc4a.tar.gz
Moved public header files from cppunit dir to include/cppunit, to separate them from internal header files like estring.h.
Diffstat (limited to 'include/cppunit/Exception.h')
-rw-r--r--include/cppunit/Exception.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/cppunit/Exception.h b/include/cppunit/Exception.h
new file mode 100644
index 0000000..eb43119
--- /dev/null
+++ b/include/cppunit/Exception.h
@@ -0,0 +1,45 @@
+#ifndef CPPUNIT_EXCEPTION_H
+#define CPPUNIT_EXCEPTION_H
+
+#include <exception>
+#include <string>
+
+namespace CppUnit {
+
+ /**
+ * Exception is an exception that serves
+ * descriptive strings through its what() method
+ *
+ */
+
+ class Exception : public exception
+ {
+ public:
+ Exception (std::string message = "",
+ long lineNumber = UNKNOWNLINENUMBER,
+ std::string fileName = UNKNOWNFILENAME);
+ Exception (const Exception& other);
+
+ virtual ~Exception ();
+
+ Exception& operator= (const Exception& other);
+
+ const char *what() const throw ();
+
+ long lineNumber ();
+ std::string fileName ();
+
+ static const std::string UNKNOWNFILENAME;
+ static const int UNKNOWNLINENUMBER;
+
+ private:
+ std::string m_message;
+ long m_lineNumber;
+ std::string m_fileName;
+
+ };
+
+} // namespace CppUnit
+
+#endif // CPPUNIT_EXCEPTION_H
+