Missing install file.
[libdcp.git] / src / exceptions.h
index 7443db151184a2564a51be25858d88f3f4d4c96d..4c53a66dd1664c10d1dc1352ac99306f71cbcfdd 100644 (file)
@@ -17,6 +17,9 @@
 
 */
 
+#ifndef LIBDCP_EXCEPTIONS_H
+#define LIBDCP_EXCEPTIONS_H
+
 /** @file  src/exceptions.h
  *  @brief Exceptions thrown by libdcp.
  */
@@ -52,7 +55,15 @@ private:
        std::string _filename;
 };
 
-
+/** @brief An exception related to an MXF file */
+class MXFFileError : public FileError
+{
+public:
+       MXFFileError (std::string const & message, std::string const & filename)
+               : FileError (message, filename)
+       {}
+};
+       
 /** @brief A miscellaneous exception */
 class MiscError : public std::exception
 {
@@ -70,4 +81,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