13
0
livetrax/libs/audiographer/audiographer/exception.h
Sakari Bergen 8da27200d1 - Fix process callbakc handling during export
- Fix filename handling when exporting multiple files
- Some updates to audiographer


git-svn-id: svn://localhost/ardour2/branches/3.0@6402 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-27 22:09:40 +00:00

38 lines
675 B
C++

#ifndef AUDIOGRAPHER_EXCEPTION_H
#define AUDIOGRAPHER_EXCEPTION_H
#include <exception>
#include <string>
#include <boost/format.hpp>
#include "audiographer/debug_utils.h"
namespace AudioGrapher
{
class Exception : public std::exception
{
public:
template<typename T>
Exception (T const & thrower, std::string const & reason)
: reason (boost::str (boost::format
("Exception thrown by %1%: %2%")
% DebugUtils::demangled_name (thrower) % reason))
{}
virtual ~Exception () throw() { }
const char* what() const throw()
{
return reason.c_str();
}
private:
std::string const reason;
};
} // namespace AudioGrapher
#endif // AUDIOGRAPHER_EXCEPTION_H