Very slightly less verbose subs checking.
[libdcp.git] / src / exceptions.h
index 7443db151184a2564a51be25858d88f3f4d4c96d..cd3c5cdb9b79a92e9fa8f13e7849e238ffeb74fe 100644 (file)
@@ -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