diff options
| author | Steve M. Robbins <smr@sumost.ca> | 2001-07-15 03:18:06 +0000 |
|---|---|---|
| committer | Steve M. Robbins <smr@sumost.ca> | 2001-07-15 03:18:06 +0000 |
| commit | 08b4a5c444044db09dc5c668390e9f40663210ff (patch) | |
| tree | f94c3f33864a238e3edc29c6fc92ebff748e82fa /include/cppunit/Exception.h | |
| parent | 8cdfc19f2213bf1de4aee4bc5e799af49b6608d0 (diff) | |
| download | cppunit-08b4a5c444044db09dc5c668390e9f40663210ff.tar.gz | |
Added documentation.
Diffstat (limited to 'include/cppunit/Exception.h')
| -rw-r--r-- | include/cppunit/Exception.h | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/include/cppunit/Exception.h b/include/cppunit/Exception.h index 1cf7548..8467c0a 100644 --- a/include/cppunit/Exception.h +++ b/include/cppunit/Exception.h @@ -6,57 +6,58 @@ namespace CppUnit { - /** - * Exception is an exception that serves - * descriptive strings through its what() method - * - */ - - class Exception : public std::exception - { +/*! \brief Exceptions thrown by failed assertions. + * + * Exception is an exception that serves + * descriptive strings through its what() method + */ +class Exception : public std::exception +{ +public: + + class Type + { public: - class Type - { - public: Type( std::string type ) : m_type ( type ) {} bool operator ==( const Type &other ) const { - return m_type == other.m_type; + return m_type == other.m_type; } - private: + private: const std::string m_type; - }; + }; - Exception( std::string message = "", - long lineNumber = UNKNOWNLINENUMBER, - std::string fileName = UNKNOWNFILENAME); - Exception (const Exception& other); + Exception( std::string message = "", + long lineNumber = UNKNOWNLINENUMBER, + std::string fileName = UNKNOWNFILENAME); + Exception (const Exception& other); - virtual ~Exception () throw(); + virtual ~Exception () throw(); - Exception& operator= (const Exception& other); + Exception& operator= (const Exception& other); - const char *what() const throw (); + const char *what() const throw (); - long lineNumber (); - std::string fileName (); + long lineNumber (); + std::string fileName (); - static const std::string UNKNOWNFILENAME; - static const long UNKNOWNLINENUMBER; + static const std::string UNKNOWNFILENAME; + static const long UNKNOWNLINENUMBER; - virtual Exception *clone() const; + virtual Exception *clone() const; + + virtual bool isInstanceOf( const Type &type ) const; - virtual bool isInstanceOf( const Type &type ) const; + static Type type(); - static Type type(); +private: + std::string m_message; + long m_lineNumber; + std::string m_fileName; +}; - private: - std::string m_message; - long m_lineNumber; - std::string m_fileName; - }; } // namespace CppUnit |
