projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separate ExceptionStore.
[dcpomatic.git]
/
src
/
lib
/
exceptions.h
diff --git
a/src/lib/exceptions.h
b/src/lib/exceptions.h
index f4631c09b67310bcf75492daca3b2b58dfd5e835..7240611ee7757b3acc760ed0acb9f4e2d571e794 100644
(file)
--- a/
src/lib/exceptions.h
+++ b/
src/lib/exceptions.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012
-2014
Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-17,21
+17,19
@@
*/
*/
-#ifndef DCPOMATIC_EXCEPTIONS_H
-#define DCPOMATIC_EXCEPTIONS_H
-
-/** @file src/exceptions.h
+/** @file src/lib/exceptions.h
* @brief Our exceptions.
*/
* @brief Our exceptions.
*/
-#include <stdexcept>
-#include <cstring>
-#include <boost/exception/all.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/thread.hpp>
+#ifndef DCPOMATIC_EXCEPTIONS_H
+#define DCPOMATIC_EXCEPTIONS_H
+
extern "C" {
#include <libavutil/pixfmt.h>
}
extern "C" {
#include <libavutil/pixfmt.h>
}
+#include <boost/filesystem.hpp>
+#include <stdexcept>
+#include <cstring>
/** @class StringError
* @brief A parent class for exceptions using messages held in a std::string
/** @class StringError
* @brief A parent class for exceptions using messages held in a std::string
@@
-40,9
+38,9
@@
class StringError : public std::exception
{
public:
/** @param w Error message */
{
public:
/** @param w Error message */
- StringError (std::string w)
{
- _what = w;
- }
+ StringError (std::string w)
+ : _what (w)
+
{
}
virtual ~StringError () throw () {}
virtual ~StringError () throw () {}
@@
-205,7
+203,7
@@
public:
{}
};
{}
};
-/** @class NetworkError
.
+/** @class NetworkError
* @brief Indicates some problem with communication on the network.
*/
class NetworkError : public StringError
* @brief Indicates some problem with communication on the network.
*/
class NetworkError : public StringError
@@
-216,6
+214,9
@@
public:
{}
};
{}
};
+/** @class KDMError
+ * @brief A problem with a KDM.
+ */
class KDMError : public StringError
{
public:
class KDMError : public StringError
{
public:
@@
-224,37
+225,42
@@
public:
{}
};
{}
};
+/** @class PixelFormatError
+ * @brief A problem with an unsupported pixel format.
+ */
class PixelFormatError : public StringError
{
public:
PixelFormatError (std::string o, AVPixelFormat f);
};
class PixelFormatError : public StringError
{
public:
PixelFormatError (std::string o, AVPixelFormat f);
};
-class ExceptionStore
+/** @class SubRipError
+ * @brief An error that occurs while parsing a SubRip file.
+ */
+class SubRipError : public FileError
{
public:
{
public:
- bool thrown () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _exception;
- }
-
- void rethrow () {
- boost::mutex::scoped_lock lm (_mutex);
- boost::rethrow_exception (_exception);
- }
+ SubRipError (std::string, std::string, boost::filesystem::path);
+};
-protected:
-
- void store_current () {
- boost::mutex::scoped_lock lm (_mutex);
- _exception = boost::current_exception ();
- }
+class DCPError : public StringError
+{
+public:
+ DCPError (std::string s)
+ : StringError (s)
+ {}
+};
-private:
- boost::exception_ptr _exception;
- mutable boost::mutex _mutex;
+class InvalidSignerError : public StringError
+{
+public:
+ InvalidSignerError ();
};
};
-
+class ProgrammingError : public StringError
+{
+public:
+ ProgrammingError (std::string file, int line);
+};
#endif
#endif