diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-30 23:47:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-30 23:47:57 +0100 |
| commit | 9a9d4e014c16be88d72914a9480343445bc785a5 (patch) | |
| tree | 1857fcdd8963d51ac50f1467d9ae81d4d9be5f8e /src/exceptions.h | |
| parent | 34a25d89b16a33b5f619ae0eaaa03c17f93980af (diff) | |
Various.
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 |
