Add a load of explicit keywords.
[dcpomatic.git] / src / lib / exceptions.h
index 75f4a8cd1bc01fbafa03851c664f268e8a433ccf..5efb045b74906cdbb77e782d61023ba709c6c77d 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
 class DecodeError : public std::runtime_error
 {
 public:
-       DecodeError (std::string s)
+       explicit DecodeError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -50,7 +50,7 @@ public:
 class EncodeError : public std::runtime_error
 {
 public:
-       EncodeError (std::string s)
+       explicit EncodeError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -84,7 +84,7 @@ private:
 class JoinError : public std::runtime_error
 {
 public:
-       JoinError (std::string s)
+       explicit JoinError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -158,7 +158,7 @@ class MissingSettingError : public SettingError
 {
 public:
        /** @param s Name of setting that was required */
-       MissingSettingError (std::string s);
+       explicit MissingSettingError (std::string s);
 };
 
 /** @class BadSettingError
@@ -167,7 +167,9 @@ public:
 class BadSettingError : public SettingError
 {
 public:
-       /** @param s Name of setting that is bad */
+       /** @param s Name of setting that is bad.
+        *  @param m Error message.
+        */
        BadSettingError (std::string s, std::string m)
                : SettingError (s, m)
        {}
@@ -179,7 +181,7 @@ public:
 class NetworkError : public std::runtime_error
 {
 public:
-       NetworkError (std::string s)
+       explicit NetworkError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -190,7 +192,7 @@ public:
 class KDMError : public std::runtime_error
 {
 public:
-       KDMError (std::string s)
+       explicit KDMError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -216,7 +218,7 @@ public:
 class DCPError : public std::runtime_error
 {
 public:
-       DCPError (std::string s)
+       explicit DCPError (std::string s)
                : std::runtime_error (s)
        {}
 };
@@ -225,20 +227,35 @@ class InvalidSignerError : public std::runtime_error
 {
 public:
        InvalidSignerError ();
+       explicit InvalidSignerError (std::string reason);
 };
 
 class ProgrammingError : public std::runtime_error
 {
 public:
-       ProgrammingError (std::string file, int line);
+       ProgrammingError (std::string file, int line, std::string message = "");
 };
 
 class TextEncodingError : public std::runtime_error
 {
 public:
-       TextEncodingError (std::string s)
+       explicit TextEncodingError (std::string s)
                : std::runtime_error (s)
        {}
 };
 
+class OldFormatError : public std::runtime_error
+{
+public:
+       explicit OldFormatError (std::string s)
+               : std::runtime_error (s)
+       {}
+};
+
+class KDMAsContentError : public std::runtime_error
+{
+public:
+       KDMAsContentError ();
+};
+
 #endif