~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/include/cppunit/plugin/DynamicLibraryManagerException.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
 
2
#define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
 
3
 
 
4
#include <cppunit/Portability.h>
 
5
 
 
6
#if !defined(CPPUNIT_NO_TESTPLUGIN)
 
7
#include <stdexcept>
 
8
#include <string>
 
9
 
 
10
 
 
11
CPPUNIT_NS_BEGIN
 
12
 
 
13
 
 
14
/*! \brief Exception thrown by DynamicLibraryManager when a failure occurs.
 
15
 *
 
16
 * Use getCause() to know what function caused the failure.
 
17
 *
 
18
 */
 
19
class DynamicLibraryManagerException : public std::runtime_error
 
20
{
 
21
public:
 
22
  enum Cause
 
23
  {
 
24
    /// Failed to load the dynamic library
 
25
    loadingFailed =0,
 
26
    /// Symbol not found in the dynamic library
 
27
    symbolNotFound
 
28
  };
 
29
 
 
30
  /// Failed to load the dynamic library or Symbol not found in the dynamic library.
 
31
  DynamicLibraryManagerException( const std::string &libraryName,
 
32
                                  const std::string &errorDetail,
 
33
                                  Cause cause );
 
34
 
 
35
  ~DynamicLibraryManagerException() throw()
 
36
  {
 
37
  }
 
38
 
 
39
  Cause getCause() const;
 
40
 
 
41
  const char *what() const throw();
 
42
 
 
43
private:
 
44
  std::string m_message;
 
45
  Cause m_cause;
 
46
};
 
47
 
 
48
 
 
49
CPPUNIT_NS_END
 
50
 
 
51
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
 
52
 
 
53
#endif  // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H