summaryrefslogtreecommitdiff
path: root/include/cppunit/Exception.h
blob: eb43119561c9da1dc28f6b1efd9bb38ec3fffaf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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