PResult.h
Go to the documentation of this file.
41 #define P_RETURN_IF_FAILURE(expr) { papillon::PResult __ret = (expr); if (__ret.Failed()) return __localErrorToStackIfFailure.Push(__ret); }
167 E_OK = 0,
168 E_ERROR_BAD_MEMORY_ALLOCATION = 1,
206 E_ERROR_UNDEFINED = 0xFFFF
405 static PResult ErrorFailedToCheckOutLicense(const PString& productName, const PString& productVersion, const PString& message);
558 PResult& LogErrorIfAny(const PString& prefix = PString::Empty(), int32 lineNumber = 0, const PString& filename = PString::Empty());
559 const PResult& LogErrorIfAny(const PString& prefix = "", papillon::int32 lineNumber = 0, const PString& filename = PString::Empty()) const
564 PResult& LogErrorIfAny2(int32 lineNumber1, const PString& filename1, const PString& prefix = PString::Empty(), papillon::int32 lineNumber2 = 0, const PString& filename2 = PString::Empty());
566 const PResult& LogErrorIfAny2(papillon::int32 lineNumber1, const PString& filename1, const PString& prefix = PString::Empty(), papillon::int32 lineNumber2 = 0, const PString& filename2 = PString::Empty()) const
568 return const_cast<PResult *>(this)->LogErrorIfAny2(lineNumber1, filename1, prefix, lineNumber2, filename2);
578 void OrDie(const PString& prefix = PString::Empty(), int32 lineNumber = 0, const PString& filename = PString::Empty()) const;
603 PResult Read(PByteStream& is, papillon::ESerialisationFormat format = papillon::E_BINARY_FORMAT);
static const PResult C_ERROR_SERIALISATION_NOT_SUPPORTED
A constant holding the "serialisation not supported" result.
Definition: PResult.h:248
Definition: PResult.h:169
static const PResult C_ERROR_UNKNOWN
A constant holding the "unknown error" result.
Definition: PResult.h:223
Definition: PResult.h:177
Definition: PResult.h:187
static const PResult C_ERROR_NOT_YET_IMPLEMENTED
A constant holding the "not yet implemented" result.
Definition: PResult.h:233
Definition: PResult.h:170
Definition: PResult.h:195
static const PResult C_FALSE
A constant holding the "false" result (not necessary an error).
Definition: PResult.h:218
const PResult & LogErrorIfAny(const PString &prefix="", papillon::int32 lineNumber=0, const PString &filename=PString::Empty()) const
Definition: PResult.h:559
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
static const PResult C_ERROR_NULL_OBJECT
A constant holding the "NULL object" result.
Definition: PResult.h:228
Definition: PResult.h:193
bool Failed() const
Returns true if the code of this result is not E_OK (failure), false otherwise.
Definition: PResult.h:537
static const PResult C_ERROR_NOT_SUPPORTED
A constant holding the "not supported" result.
Definition: PResult.h:238
Definition: PResult.h:174
Definition: PResult.h:184
Definition: PResult.h:186
Definition: PResult.h:196
static const PResult C_ERROR_NO_PRIVATE_IMPLEMENTATION
A constant holding the "no implementation" result.
Definition: PResult.h:243
Class PString: an unicode character strings (use copy-on-write idiom).
The PByteStream class is a generic byte stream (can be a memory stream or a file stream).
Definition: PByteStream.h:69
static const PString & Empty()
Returns the constant holding the empty string "".
Definition: PString.h:64
bool operator!() const
Enables a PResult object to be cast to boolean easily.
Definition: PResult.h:485
Definition: PResult.h:176
Definition: PResult.h:198
Definition: PResult.h:185
Definition: PResult.h:199
Definition: PResult.h:172
Definition: PResult.h:203
const PResult & LogErrorIfAny2(papillon::int32 lineNumber1, const PString &filename1, const PString &prefix=PString::Empty(), papillon::int32 lineNumber2=0, const PString &filename2=PString::Empty()) const
Definition: PResult.h:566
Definition: PResult.h:200
Definition: PResult.h:201
Definition: PResult.h:171
Definition: PResult.h:194
Definition: PResult.h:204
Definition: PResult.h:188