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
Branches
Tags
No related merge requests found
......@@ -34,7 +34,7 @@
#ifndef __AUDIOFILE_H__
#define __AUDIOFILE_H__
#include <exception>
#include <stdexcept>
#include <fstream>
#include "audio/audioloop.h"
......@@ -43,22 +43,11 @@ namespace sfl {
class AudioCodec;
}
class AudioFileException : public std::exception
class AudioFileException : public std::runtime_error
{
public:
AudioFileException (const std::string& str="") throw() : errstr(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;
AudioFileException (const std::string& str="") :
std::runtime_error("AudioFile: AudioFileException occured: " + str) {}
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment