9 #ifndef anna_dbms_ResultCode_hpp 10 #define anna_dbms_ResultCode_hpp 36 ResultCode() : a_errorText(NULL), a_errorDecoder(NULL), a_errorCode(0) {;}
44 a_errorDecoder(other.a_errorDecoder) {
45 set(other.a_errorCode, other.a_errorText);
51 virtual ~ResultCode() {
if(a_errorText != NULL) free(a_errorText); }
63 const char*
getErrorText()
const {
return (a_errorText != NULL) ? a_errorText :
""; }
73 if(
this != &resultCode) {
74 a_errorDecoder = resultCode.a_errorDecoder;
75 set(resultCode.a_errorCode, resultCode.a_errorText);
87 bool notFound()
const noexcept(
false);
105 bool locked()
const noexcept(
false);
128 virtual bool notFound(
const int errorCode)
const = 0;
129 virtual bool successful(
const int errorCode)
const = 0;
130 virtual bool locked(
const int errorCode)
const = 0;
144 a_errorDecoder(errorDecoder) {
145 set(errorCode, errorText);
154 void set(
const int errorCode,
const char* errorText)
156 a_errorCode = errorCode;
165 void copy(
const char* text) ;
virtual ~ResultCode()
Definition: ResultCode.hpp:51
ResultCode(const ResultCode &other)
Definition: ResultCode.hpp:42
ResultCode(const int errorCode, const char *errorText, const ErrorDecoder *errorDecoder)
Definition: ResultCode.hpp:142
Definition: ResultCode.hpp:126
ResultCode & operator=(const ResultCode &resultCode)
Definition: ResultCode.hpp:71
static const int MaxErrorLen
Definition: ResultCode.hpp:120
virtual bool lostConnection(const int errorCode) const =0
int getErrorCode() const
Definition: ResultCode.hpp:57
virtual bool notFound(const int errorCode) const =0
virtual bool successful(const int errorCode) const =0
bool notFound() const noexcept(false)
std::string asString() const
virtual bool locked(const int errorCode) const =0
bool locked() const noexcept(false)
bool lostConnection() const noexcept(false)
Definition: ResultCode.hpp:29
const char * getErrorText() const
Definition: ResultCode.hpp:63
ResultCode()
Definition: ResultCode.hpp:36
bool successful() const noexcept(false)