From 2a429ca76b97cca197f105b665271360b74f6917 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 14 Aug 2012 04:22:07 +0000 Subject: Remove glib dependency. Make Symbol, URI, and Path simpler derivatives of std::string. 100% test coverage by line for Symbol, URI, Path, AtomicInt, and AtomicPtr. Add Raul::Exception. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4686 a436a847-0d15-0410-975c-d299462d15a1 --- raul/Exception.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 raul/Exception.hpp (limited to 'raul/Exception.hpp') diff --git a/raul/Exception.hpp b/raul/Exception.hpp new file mode 100644 index 0000000..4969ab2 --- /dev/null +++ b/raul/Exception.hpp @@ -0,0 +1,34 @@ +/* + This file is part of Raul. + Copyright 2007-2012 David Robillard + + Raul is free software: you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation, either version 3 of the License, or any later version. + + Raul is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Raul. If not, see . +*/ + +#include +#include + +#ifndef RAUL_EXCEPTION_HPP +#define RAUL_EXCEPTION_HPP + +/** An exception (unexpected error). */ +class Exception : public std::exception { +public: + const char* what() const throw() { return _what.c_str(); } + ~Exception() throw() {} +protected: + explicit Exception(const std::string& what) : _what(what) {} +private: + const std::string _what; +}; + +#endif // RAUL_EXCEPTION_HPP -- cgit v1.2.1