Translation fixes from Lilian Lefranc.
[dcpomatic.git] / src / lib / exceptions.h
index e757d25069c9182455c5185aeb2183664c2c7a17..e45a62353bf57fa7085701828ccfbc6eec1d2791 100644 (file)
  */
 
 #include <stdexcept>
-#include <sstream>
 #include <cstring>
 #include <boost/exception/all.hpp>
 #include <boost/thread.hpp>
+extern "C" {
+#include <libavutil/pixfmt.h>
+}
 
 /** @class StringError
  *  @brief A parent class for exceptions using messages held in a std::string
@@ -110,9 +112,7 @@ class OpenFileError : public FileError
 {
 public:
        /** @param f File that we were trying to open */
-       OpenFileError (std::string f)
-               : FileError ("could not open file " + f, f)
-       {}
+       OpenFileError (std::string f);
 };
 
 /** @class CreateFileError.
@@ -122,9 +122,7 @@ class CreateFileError : public FileError
 {
 public:
        /** @param f File that we were trying to create */
-       CreateFileError (std::string f)
-               : FileError ("could not create file " + f, f)
-       {}
+       CreateFileError (std::string f);
 };
 
 
@@ -137,16 +135,7 @@ public:
        /** @param f File that we were trying to read from.
         *  @param e errno value, or 0.
         */
-       ReadFileError (std::string f, int e = 0)
-               : FileError ("", f)
-       {
-               std::stringstream s;
-               s << "could not read from file " << f;
-               if (e) {
-                       s << " (" << strerror (e) << ")";
-               }
-               _what = s.str ();
-       }
+       ReadFileError (std::string f, int e = 0);
 };
 
 /** @class WriteFileError.
@@ -158,16 +147,7 @@ public:
        /** @param f File that we were trying to write to.
         *  @param e errno value, or 0.
         */
-       WriteFileError (std::string f, int e)
-               : FileError ("", f)
-       {
-               std::stringstream s;
-               s << "could not write to file " << f;
-               if (e) {
-                       s << " (" << strerror (e) << ")";
-               }
-               _what = s.str ();
-       }
+       WriteFileError (std::string f, int e);
 };
 
 /** @class SettingError.
@@ -202,9 +182,7 @@ class MissingSettingError : public SettingError
 {
 public:
        /** @param s Name of setting that was required */
-       MissingSettingError (std::string s)
-               : SettingError (s, "missing required setting " + s)
-       {}
+       MissingSettingError (std::string s);
 };
 
 /** @class BadSettingError
@@ -230,6 +208,12 @@ public:
        {}
 };
 
+class PixelFormatError : public StringError
+{
+public:
+       PixelFormatError (std::string o, AVPixelFormat f);
+};
+
 class ExceptionStore
 {
 public:
@@ -255,4 +239,6 @@ private:
        mutable boost::mutex _mutex;
 };
 
+       
+
 #endif