summaryrefslogtreecommitdiff
path: root/include/cppunit/plugin/DynamicLibraryManagerException.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cppunit/plugin/DynamicLibraryManagerException.h')
-rw-r--r--include/cppunit/plugin/DynamicLibraryManagerException.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/cppunit/plugin/DynamicLibraryManagerException.h b/include/cppunit/plugin/DynamicLibraryManagerException.h
new file mode 100644
index 0000000..c6b956a
--- /dev/null
+++ b/include/cppunit/plugin/DynamicLibraryManagerException.h
@@ -0,0 +1,49 @@
+#ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
+#define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
+
+#include <cppunit/Portability.h>
+
+#if !defined(CPPUNIT_NO_TESTPLUGIN)
+#include <stdexcept>
+#include <string>
+
+
+namespace CppUnit
+{
+
+/*! \brief Exception thrown by DynamicLibraryManager when a failure occurs.
+ *
+ * Use getCause() to know what function caused the failure.
+ *
+ */
+class DynamicLibraryManagerException : public std::runtime_error
+{
+public:
+ enum Cause
+ {
+ /// Failed to load the dynamic library
+ loadingFailed =0,
+ /// Symbol not found in the dynamic library
+ symbolNotFound,
+ };
+
+ /// Failed to load the dynamic library
+ DynamicLibraryManagerException( const std::string &libraryName );
+
+ /// Symbol not found in the dynamic library
+ DynamicLibraryManagerException( const std::string &libraryName,
+ const std::string &symbol );
+
+ Cause getCause() const;
+
+private:
+ Cause m_cause;
+};
+
+
+} // namespace CppUnit
+
+
+#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
+
+#endif // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H