You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
851 B
C
45 lines
851 B
C
|
4 years ago
|
/******************************************************************************
|
||
|
|
* File - OpRes.h
|
||
|
|
* Author - Joey Pollack
|
||
|
|
* Date - 2020/03/05 (y/m/d)
|
||
|
|
* Mod Date - 2020/03/05 (y/m/d)
|
||
|
|
* Description - Operation Result. Also contains a message describing the result.
|
||
|
|
*
|
||
|
|
******************************************************************************/
|
||
|
|
|
||
|
|
#ifndef _OPERATION_RESULT_H_
|
||
|
|
#define _OPERATION_RESULT_H_
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
|
||
|
|
namespace lunarium
|
||
|
|
{
|
||
|
|
enum ResultType
|
||
|
|
{
|
||
|
|
OK,
|
||
|
|
WARNING, // Not used yet
|
||
|
|
FAIL
|
||
|
|
};
|
||
|
|
|
||
|
|
struct OpRes
|
||
|
|
{
|
||
|
|
ResultType Type;
|
||
|
|
std::string Description;
|
||
|
|
|
||
|
|
bool operator==(const OpRes& rhs);
|
||
|
|
|
||
|
|
bool operator==(ResultType rhs);
|
||
|
|
|
||
|
|
static OpRes OK();
|
||
|
|
|
||
|
|
static OpRes Fail(const char* why);
|
||
|
|
};
|
||
|
|
|
||
|
|
bool IsOK(OpRes&& res);
|
||
|
4 years ago
|
bool IsOK(OpRes& res);
|
||
|
4 years ago
|
|
||
|
|
bool Failed(OpRes&& res);
|
||
|
4 years ago
|
bool Failed(OpRes& res);
|
||
|
4 years ago
|
}
|
||
|
|
|
||
|
|
#endif // _OPERATION_RESULT_H_
|