From 07b3b786e72ec07839d1b4b07cf82af5efc6bd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <rafael.carre@savoirfairelinux.com> Date: Thu, 28 Jul 2011 14:28:04 -0400 Subject: [PATCH] * #6547: DTMFException: use runtime exceptions --- .../src/audio/sound/dtmfgenerator.cpp | 16 ---------- .../src/audio/sound/dtmfgenerator.h | 30 ++----------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/sflphone-common/src/audio/sound/dtmfgenerator.cpp b/sflphone-common/src/audio/sound/dtmfgenerator.cpp index 82f898b722..474d25aea9 100644 --- a/sflphone-common/src/audio/sound/dtmfgenerator.cpp +++ b/sflphone-common/src/audio/sound/dtmfgenerator.cpp @@ -62,22 +62,6 @@ const DTMFGenerator::DTMFTone DTMFGenerator::tones[NUM_TONES] = { }; -DTMFException::DTMFException (const char* _reason) throw() : reason (_reason) -{ -} - - -DTMFException::~DTMFException() throw() -{ -} - -const char* DTMFException::what() const throw() -{ - return reason; -} - - - /* * Initialize the generator */ diff --git a/sflphone-common/src/audio/sound/dtmfgenerator.h b/sflphone-common/src/audio/sound/dtmfgenerator.h index 1055f6f8cc..ebf50bba5b 100644 --- a/sflphone-common/src/audio/sound/dtmfgenerator.h +++ b/sflphone-common/src/audio/sound/dtmfgenerator.h @@ -36,7 +36,7 @@ #ifndef DTMFGENERATOR_H #define DTMFGENERATOR_H -#include <exception> +#include <stdexcept> #include <string.h> #include "tone.h" @@ -47,34 +47,10 @@ * @file dtmfgenerator.h * @brief DMTF Generator Exception */ -class DTMFException : public std::exception +class DTMFException : public std::runtime_error { - private: - - /** Message */ - const char* reason; public: - /** - * Constructor - * @param _reason An error message - */ - DTMFException (const char* _reason) throw(); - - /** - * Destructor - */ - virtual ~DTMFException() throw(); - /* - // Copy Constructor - DTMFException(const DTMFException& rh) throw(); - - // Assignment Operator - DTMFException& operator=( const DTMFException& rh) throw(); - */ - /** - * @return const char* The error - */ - virtual const char* what() const throw(); + DTMFException(const std::string& str) : std::runtime_error(str) {}; }; /* -- GitLab