From 9a9d4e014c16be88d72914a9480343445bc785a5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 30 Jul 2012 23:47:57 +0100 Subject: Various. --- src/exceptions.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/exceptions.h') diff --git a/src/exceptions.h b/src/exceptions.h index 7443db15..cd3c5cdb 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -17,6 +17,9 @@ */ +#ifndef LIBDCP_EXCEPTIONS_H +#define LIBDCP_EXCEPTIONS_H + /** @file src/exceptions.h * @brief Exceptions thrown by libdcp. */ @@ -70,4 +73,40 @@ private: std::string _message; }; +/** @brief A DCP read exception */ +class DCPReadError : public std::exception +{ +public: + DCPReadError (std::string const & message) : _message (message) {} + ~DCPReadError () throw () {} + + /** @return error message */ + char const * what () const throw () { + return _message.c_str (); + } + +private: + /** error message */ + std::string _message; +}; + +/** @brief An XML error */ +class XMLError : public std::exception +{ +public: + XMLError (std::string const & message) : _message (message) {} + ~XMLError () throw () {} + + /** @return error message */ + char const * what () const throw () { + return _message.c_str (); + } + +private: + /** error message */ + std::string _message; +}; + } + +#endif -- cgit v1.2.3