2 * File: SyncException.cpp
4 * Author: Lukas Zeller (luz@synthesis.ch)
7 * SySync Exception classes
9 * Copyright (c) 2001-2009 by Synthesis AG (www.synthesis.ch)
11 * 2001-05-28 : luz : created
15 #ifndef SyncException_H
16 #define SyncException_H
23 #if defined(WINCE) || defined(__EPOC_OS__) || defined(ANDROID)
24 // eVC + EPOC cannot process throw() qualifier
26 // eVC + EPOC has no exception base class
31 exception(const exception&) {};
32 exception& operator= (const exception&) {return *this;};
33 virtual ~exception() {};
34 virtual const char* what() const {return "exception";};
37 #define NOTHROW throw()
40 class TSyncException : public exception
42 typedef exception inherited;
44 TSyncException(const char *aMsg1, localstatus aLocalStatus=LOCERR_EXCEPTION) NOTHROW;
45 TSyncException(localstatus aLocalStatus) NOTHROW;
46 TSyncException() NOTHROW { fLocalStatus=LOCERR_EXCEPTION; };
47 virtual ~TSyncException() NOTHROW;
48 virtual const char * what() const NOTHROW;
49 localstatus status(void) NOTHROW { return fLocalStatus; }
51 void setMsg(const char *p);
54 localstatus fLocalStatus;
58 class TSmlException : public TSyncException
60 typedef TSyncException inherited;
62 TSmlException(const char *aMsg, Ret_t aSmlError) NOTHROW;
63 Ret_t getSmlError(void) { return fSmlError; };
70 class TStructException : public TSyncException
72 typedef TSyncException inherited;
74 TStructException(const char *aMsg) NOTHROW: TSyncException (aMsg) {};
75 }; // TStructException
78 class TMemException : public TSyncException
80 typedef TSyncException inherited;
82 TMemException(const char *aMsg) NOTHROW: TSyncException (aMsg) {};
88 #endif // SyncException_H