From 58fa55cf44c8b87ae3edb8f24fbac128649a7255 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 31 Mar 2022 23:52:06 -0700 Subject: Added real exceptions based on QException. These may not be stl compatible, which would be sad. They seem to work in practice, though. --- c++-qt/gats-qt/parseexception.h | 25 +++++++++++++++++++++++++ c++-qt/gats-qt/typeexception.h | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 c++-qt/gats-qt/parseexception.h create mode 100644 c++-qt/gats-qt/typeexception.h (limited to 'c++-qt/gats-qt') 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 @@ +#ifndef GATS_PARSE_EXCEPTION_H +#define GATS_PARSE_EXCEPTION_H + +#include + +namespace Gats +{ + class ParseException : public QException + { + public: + ParseException( const char * const sMessage ); + ParseException( const ParseException &rSrc ); + virtual ~ParseException(); + + virtual QException *clone() const; + virtual void raise() const; + + virtual const char *what() const noexcept; + + private: + const char *sMessage; + }; +}; + +#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 @@ +#ifndef GATS_TYPE_EXCEPTION_H +#define GATS_TYPE_EXCEPTION_H + +#include + +namespace Gats +{ + class TypeException : public QException + { + public: + TypeException( const char * const sMessage ); + TypeException( const TypeException &rSrc ); + virtual ~TypeException(); + + virtual QException *clone() const; + virtual void raise() const; + + virtual const char *what() const noexcept; + + private: + const char *sMessage; + }; +}; + +#endif + -- cgit v1.2.3