Skip to content
Snippets Groups Projects
Commit 80e0096e authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6547: AudioFile: use runtime exceptions

Avoid using stack variables out of their scope
parent c738b4ea
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#ifndef __AUDIOFILE_H__ #ifndef __AUDIOFILE_H__
#define __AUDIOFILE_H__ #define __AUDIOFILE_H__
#include <exception> #include <stdexcept>
#include <fstream> #include <fstream>
#include "audio/audioloop.h" #include "audio/audioloop.h"
...@@ -43,22 +43,11 @@ namespace sfl { ...@@ -43,22 +43,11 @@ namespace sfl {
class AudioCodec; class AudioCodec;
} }
class AudioFileException : public std::exception class AudioFileException : public std::runtime_error
{ {
public: public:
AudioFileException (const std::string& str="") throw() : errstr(str) {} AudioFileException (const std::string& str="") :
std::runtime_error("AudioFile: AudioFileException occured: " + str) {}
virtual ~AudioFileException() throw() {}
virtual const char *what() const throw() {
std::string expt("AudioFile: AudioFileException occured: ");
expt.append(errstr);
return expt.c_str();
}
private:
std::string errstr;
}; };
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment