Blame include/cppunit/Exception.h

Packit 8c9aa0
#ifndef CPPUNIT_EXCEPTION_H
Packit 8c9aa0
#define CPPUNIT_EXCEPTION_H
Packit 8c9aa0
Packit 8c9aa0
#include <cppunit/Portability.h>
Packit 8c9aa0
#include <cppunit/Message.h>
Packit 8c9aa0
#include <cppunit/SourceLine.h>
Packit 8c9aa0
#include <exception>
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
CPPUNIT_NS_BEGIN
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
/*! \brief Exceptions thrown by failed assertions.
Packit 8c9aa0
 * \ingroup BrowsingCollectedTestResult
Packit 8c9aa0
 *
Packit 8c9aa0
 * Exception is an exception that serves
Packit 8c9aa0
 * descriptive strings through its what() method
Packit 8c9aa0
 */
Packit 8c9aa0
class CPPUNIT_API Exception : public std::exception
Packit 8c9aa0
{
Packit 8c9aa0
public:
Packit 8c9aa0
  /*! \brief Constructs the exception with the specified message and source location.
Packit 8c9aa0
   * \param message Message associated to the exception.
Packit 8c9aa0
   * \param sourceLine Source location related to the exception.
Packit 8c9aa0
   */
Packit 8c9aa0
  Exception( const Message &message = Message(), 
Packit 8c9aa0
             const SourceLine &sourceLine = SourceLine() );
Packit 8c9aa0
Packit 8c9aa0
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
Packit 8c9aa0
  /*!
Packit 8c9aa0
   * \deprecated Use other constructor instead.
Packit 8c9aa0
   */
Packit 8c9aa0
  Exception( std::string  message, 
Packit 8c9aa0
	     long lineNumber, 
Packit 8c9aa0
	     std::string fileName );
Packit 8c9aa0
#endif
Packit 8c9aa0
Packit 8c9aa0
  /*! \brief Constructs a copy of an exception.
Packit 8c9aa0
   * \param other Exception to copy.
Packit 8c9aa0
   */
Packit 8c9aa0
  Exception( const Exception &other );
Packit 8c9aa0
Packit 8c9aa0
  /// Destructs the exception
Packit 8c9aa0
  virtual ~Exception() throw();
Packit 8c9aa0
Packit 8c9aa0
  /// Performs an assignment
Packit 8c9aa0
  Exception &operator =( const Exception &other );
Packit 8c9aa0
Packit 8c9aa0
  /// Returns descriptive message
Packit 8c9aa0
  const char *what() const throw();
Packit 8c9aa0
Packit 8c9aa0
  /// Location where the error occured
Packit 8c9aa0
  SourceLine sourceLine() const;
Packit 8c9aa0
Packit 8c9aa0
  /// Message related to the exception.
Packit 8c9aa0
  Message message() const;
Packit 8c9aa0
Packit 8c9aa0
  /// Set the message.
Packit 8c9aa0
  void setMessage( const Message &message );
Packit 8c9aa0
Packit 8c9aa0
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
Packit 8c9aa0
  /// The line on which the error occurred
Packit 8c9aa0
  long lineNumber() const;
Packit 8c9aa0
Packit 8c9aa0
  /// The file in which the error occurred
Packit 8c9aa0
  std::string fileName() const;
Packit 8c9aa0
Packit 8c9aa0
  static const std::string UNKNOWNFILENAME;
Packit 8c9aa0
  static const long UNKNOWNLINENUMBER;
Packit 8c9aa0
#endif
Packit 8c9aa0
Packit 8c9aa0
  /// Clones the exception.
Packit 8c9aa0
  virtual Exception *clone() const;
Packit 8c9aa0
Packit 8c9aa0
protected:
Packit 8c9aa0
  // VC++ does not recognize call to parent class when prefixed
Packit 8c9aa0
  // with a namespace. This is a workaround.
Packit 8c9aa0
  typedef std::exception SuperClass;
Packit 8c9aa0
Packit 8c9aa0
  Message m_message;
Packit 8c9aa0
  SourceLine m_sourceLine;
Packit 8c9aa0
  std::string m_whatMessage;
Packit 8c9aa0
};
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
CPPUNIT_NS_END
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
#endif // CPPUNIT_EXCEPTION_H
Packit 8c9aa0