diff options
| author | Mike Buland <mike@xagasoft.com> | 2022-03-31 23:52:06 -0700 |
|---|---|---|
| committer | Mike Buland <mike@xagasoft.com> | 2022-03-31 23:52:06 -0700 |
| commit | 58fa55cf44c8b87ae3edb8f24fbac128649a7255 (patch) | |
| tree | 5e879a71edffc7dcabb242dece0212723d90c64d /c++-qt/gats-qt | |
| parent | bee0b9c862d5eb325b8c29767a89b3d895b5f5a9 (diff) | |
| download | libgats-58fa55cf44c8b87ae3edb8f24fbac128649a7255.tar.gz libgats-58fa55cf44c8b87ae3edb8f24fbac128649a7255.tar.bz2 libgats-58fa55cf44c8b87ae3edb8f24fbac128649a7255.tar.xz libgats-58fa55cf44c8b87ae3edb8f24fbac128649a7255.zip | |
Added real exceptions based on QException.
These may not be stl compatible, which would be sad. They seem to work
in practice, though.
Diffstat (limited to '')
| -rw-r--r-- | c++-qt/gats-qt/parseexception.h | 25 | ||||
| -rw-r--r-- | c++-qt/gats-qt/typeexception.h | 26 |
2 files changed, 51 insertions, 0 deletions
diff --git a/c++-qt/gats-qt/parseexception.h b/c++-qt/gats-qt/parseexception.h new file mode 100644 index 0000000..24b26ae --- /dev/null +++ b/c++-qt/gats-qt/parseexception.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef GATS_PARSE_EXCEPTION_H | ||
| 2 | #define GATS_PARSE_EXCEPTION_H | ||
| 3 | |||
| 4 | #include <QException> | ||
| 5 | |||
| 6 | namespace Gats | ||
| 7 | { | ||
| 8 | class ParseException : public QException | ||
| 9 | { | ||
| 10 | public: | ||
| 11 | ParseException( const char * const sMessage ); | ||
| 12 | ParseException( const ParseException &rSrc ); | ||
| 13 | virtual ~ParseException(); | ||
| 14 | |||
| 15 | virtual QException *clone() const; | ||
| 16 | virtual void raise() const; | ||
| 17 | |||
| 18 | virtual const char *what() const noexcept; | ||
| 19 | |||
| 20 | private: | ||
| 21 | const char *sMessage; | ||
| 22 | }; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/c++-qt/gats-qt/typeexception.h b/c++-qt/gats-qt/typeexception.h new file mode 100644 index 0000000..93d00ba --- /dev/null +++ b/c++-qt/gats-qt/typeexception.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef GATS_TYPE_EXCEPTION_H | ||
| 2 | #define GATS_TYPE_EXCEPTION_H | ||
| 3 | |||
| 4 | #include <QException> | ||
| 5 | |||
| 6 | namespace Gats | ||
| 7 | { | ||
| 8 | class TypeException : public QException | ||
| 9 | { | ||
| 10 | public: | ||
| 11 | TypeException( const char * const sMessage ); | ||
| 12 | TypeException( const TypeException &rSrc ); | ||
| 13 | virtual ~TypeException(); | ||
| 14 | |||
| 15 | virtual QException *clone() const; | ||
| 16 | virtual void raise() const; | ||
| 17 | |||
| 18 | virtual const char *what() const noexcept; | ||
| 19 | |||
| 20 | private: | ||
| 21 | const char *sMessage; | ||
| 22 | }; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
| 26 | |||
