Mercurial > dedupe
changeset 28:b2c2c2bf2bbd
Refactor Exceptions into a separate directory.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 06 Sep 2012 18:29:43 +0200 |
| parents | 95a10553ff90 |
| children | ad9c92d782dd |
| files | CMakeLists.txt DataController.cpp DeDupe.cpp Exception.hpp Exception/Exception.hpp Exception/IOException.cpp Exception/IOException.hpp Exception/InvalidDataException.hpp Exception/NoSuchValueException.hpp Exception/PermissionException.hpp Exception/ValueExistsException.hpp FileDBLink.cpp HuffmanSet.cpp IOException.cpp IOException.hpp InvalidDataException.hpp NoSuchValueException.hpp PermissionException.hpp RBTree.hpp TestBitDecoder.cpp ValueExistsException.hpp updateDeDupe.cpp |
| diffstat | 22 files changed, 100 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Thu Sep 06 18:20:11 2012 +0200 +++ b/CMakeLists.txt Thu Sep 06 18:29:43 2012 +0200 @@ -29,7 +29,7 @@ HuffmanString.cpp HuffmanSet.cpp EditDistance.cpp - IOException.cpp + Exception/IOException.cpp FileDBLink.cpp SqliteDBLink.cpp MemoryDBLink.cpp @@ -40,7 +40,7 @@ SET(CLASS_HEADERS DataController.hpp EditDistance.hpp - IOException.hpp + Exception/IOException.hpp FileDBLink.hpp SqliteDBLink.hpp MemoryDBLink.hpp
--- a/DataController.cpp Thu Sep 06 18:20:11 2012 +0200 +++ b/DataController.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -2,7 +2,7 @@ #include "DataController.hpp" #include "EditDistance.hpp" #include "MemoryDBLink.hpp" -#include "PermissionException.hpp" +#include "Exception/PermissionException.hpp" #include "SqliteDBLink.hpp" #include "ConfigurationProcessing.hpp"
--- a/DeDupe.cpp Thu Sep 06 18:20:11 2012 +0200 +++ b/DeDupe.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -1,5 +1,5 @@ #include "DataController.hpp" -#include "Exception.hpp" +#include "Exception/Exception.hpp" #include <QtGui/QApplication>
--- a/Exception.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#ifndef EXCEPTION_HPP -#define EXCEPTION_HPP - -#include <QtCore/QString> - -class Exception { - -public: - typedef QString string_t; - - virtual const string_t& toString() const - { - return errorMsg_; - } - void raise() const - { - throw *this; - } - - -protected: - Exception(const string_t& errorMsg = string_t()) : errorMsg_(errorMsg) {} - virtual ~Exception() {} - - void setErrorMsg(string_t& errorMsg); - const string_t& errorMsg(string_t& errorMsg); - -private: - string_t errorMsg_; -}; - -#endif //EXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/Exception.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,32 @@ +#ifndef EXCEPTION_HPP +#define EXCEPTION_HPP + +#include <QtCore/QString> + +class Exception { + +public: + typedef QString string_t; + + virtual const string_t& toString() const + { + return errorMsg_; + } + void raise() const + { + throw *this; + } + + +protected: + Exception(const string_t& errorMsg = string_t()) : errorMsg_(errorMsg) {} + virtual ~Exception() {} + + void setErrorMsg(string_t& errorMsg); + const string_t& errorMsg(string_t& errorMsg); + +private: + string_t errorMsg_; +}; + +#endif //EXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/IOException.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,5 @@ +#include "IOException.hpp" + +IOException::IOException(const QString& errorMsg) : Exception(errorMsg) +{ +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/IOException.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,11 @@ +#ifndef IOEXCEPTION_HPP +#define IOEXCEPTION_HPP + +#include "Exception.hpp" + +class IOException : public Exception { +public: + IOException(const string_t& errMsg); +}; + +#endif //IOEXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/InvalidDataException.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,10 @@ +#ifndef INVALIDDATAEXCEPTION_HPP +#define INVALIDDATAEXCEPTION_HPP + +#include "Exception.hpp" + +class InvalidDataException : public Exception +{ +}; + +#endif //INVALIDDATAEXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/NoSuchValueException.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,10 @@ +#ifndef NOSUCHVALUEEXCEPTION_HPP +#define NOSUCHVALUEEXCEPTION_HPP + +#include "Exception.hpp" + +class NoSuchValueException : public Exception +{ +}; + +#endif //NOSUCHVALUEEXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/PermissionException.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,12 @@ +#ifndef PERMISSIONEXCEPTION_HPP +#define PERMISSIONEXCEPTION_HPP + +#include "IOException.hpp" + +class PermissionException : public IOException { +public: + PermissionException(const string_t& errorMsg) : IOException(errorMsg) {} + +}; + +#endif //PERMISSIONEXCEPTION_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Exception/ValueExistsException.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -0,0 +1,10 @@ +#ifndef VALUEEXISTSEXCEPTION_HPP +#define VALUEEXISTSEXCEPTION_HPP + +#include "Exception.hpp" + +class ValueExistsException : public Exception +{ +}; + +#endif //VALUEEXISTSEXCEPTION_HPP
--- a/FileDBLink.cpp Thu Sep 06 18:20:11 2012 +0200 +++ b/FileDBLink.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -1,6 +1,6 @@ #include "EditDistance.hpp" #include "FileDBLink.hpp" -#include "PermissionException.hpp" +#include "Exception/PermissionException.hpp" #include <QtCore/QDebug> #include <QtCore/QtConcurrentMap>
--- a/HuffmanSet.cpp Thu Sep 06 18:20:11 2012 +0200 +++ b/HuffmanSet.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -1,6 +1,6 @@ #include "HuffmanString.hpp" -#include "NoSuchValueException.hpp" -#include "InvalidDataException.hpp" +#include "Exception/NoSuchValueException.hpp" +#include "Exception/InvalidDataException.hpp" #include <QtCore/QHash>
--- a/IOException.cpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -#include "IOException.hpp" - -IOException::IOException(const QString& errorMsg) : Exception(errorMsg) -{ -}
--- a/IOException.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -#ifndef IOEXCEPTION_HPP -#define IOEXCEPTION_HPP - -#include "Exception.hpp" - -class IOException : public Exception { -public: - IOException(const string_t& errMsg); -}; - -#endif //IOEXCEPTION_HPP
--- a/InvalidDataException.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef INVALIDDATAEXCEPTION_HPP -#define INVALIDDATAEXCEPTION_HPP - -#include "Exception.hpp" - -class InvalidDataException : public Exception -{ -}; - -#endif //INVALIDDATAEXCEPTION_HPP
--- a/NoSuchValueException.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef NOSUCHVALUEEXCEPTION_HPP -#define NOSUCHVALUEEXCEPTION_HPP - -#include "Exception.hpp" - -class NoSuchValueException : public Exception -{ -}; - -#endif //NOSUCHVALUEEXCEPTION_HPP
--- a/PermissionException.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#ifndef PERMISSIONEXCEPTION_HPP -#define PERMISSIONEXCEPTION_HPP - -#include "IOException.hpp" - -class PermissionException : public IOException { -public: - PermissionException(const string_t& errorMsg) : IOException(errorMsg) {} - -}; - -#endif //PERMISSIONEXCEPTION_HPP
--- a/RBTree.hpp Thu Sep 06 18:20:11 2012 +0200 +++ b/RBTree.hpp Thu Sep 06 18:29:43 2012 +0200 @@ -3,7 +3,7 @@ #include <boost/optional.hpp> #include <cmath> -#include "ValueExistsException.hpp" +#include "Exception/ValueExistsException.hpp" #include <QtCore/QDebug>
--- a/TestBitDecoder.cpp Thu Sep 06 18:20:11 2012 +0200 +++ b/TestBitDecoder.cpp Thu Sep 06 18:29:43 2012 +0200 @@ -1,7 +1,7 @@ #include "BitDecoder.hpp" #include "TestFramework.hpp" -#include "InvalidDataException.hpp" +#include "Exception/InvalidDataException.hpp" #include <QtCore/QDebug> QBitArray bitsFromString(const QString& str)
--- a/ValueExistsException.hpp Thu Sep 06 18:20:11 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef VALUEEXISTSEXCEPTION_HPP -#define VALUEEXISTSEXCEPTION_HPP - -#include "Exception.hpp" - -class ValueExistsException : public Exception -{ -}; - -#endif //VALUEEXISTSEXCEPTION_HPP
