#ifndef GLREXCEPTION #define GLREXCEPTION #include #include using namespace std; class glrException { protected: string msg; public: const string& message() const { return msg; } glrException(const string &msgA){ msg = msgA; } glrException() {}; }; class glrNoSuchTextSymbolException : public glrException { public: glrNoSuchTextSymbolException(const string &msgA) : glrException(msgA) { }; }; class glrNoSuchSymbolException : public glrException { public: glrNoSuchSymbolException(const string &msgA) : glrException(msgA) { }; }; class glrPointerCounterUnderflowException : public glrException { public: glrPointerCounterUnderflowException(const int &numOfPointers){ ostrstream out; out << "glrGuard::release(): attempt to call ->release() on object with pointer counter set to " << numOfPointers << ends; msg = out.str(); } }; class glrInvalidDeleteException : public glrException { public: glrInvalidDeleteException(const int &numOfPointers){ ostrstream out; out << "glrGuard::~glrGuard(): attempt to delete object with pointer counter set to " << numOfPointers << ends; msg = out.str(); } }; class glrLostOwnParentException : public glrException { public: glrLostOwnParentException(const string &msgA) : glrException(msgA) {} }; class glrQuesCompareException : public glrException { public: glrQuesCompareException(const string &msgA) : glrException(msgA) {} }; class glrIndexOutOfBoundsException: public glrException { public: glrIndexOutOfBoundsException(const string &msgA) : glrException(msgA) {} }; class glrEmptyContainerException: public glrException { public: glrEmptyContainerException(const string &msgA) : glrException(msgA) {} }; class glrIOErrorException : public glrException { public: glrIOErrorException(){} glrIOErrorException(const string &msgA) : glrException(msgA) {} }; class glrSyntaxErrorException : public glrIOErrorException { public: glrSyntaxErrorException(const string &msgA,const int &lineNo){ ostrstream out; out << msgA << lineNo << ends; msg = out.str(); } }; #endif