diff options
Diffstat (limited to 'src/exceptions.h')
| -rw-r--r-- | src/exceptions.h | 39 |
1 files changed, 39 insertions, 0 deletions
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 |
