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.
lunarium_OLD/src/utils/opRes.h

45 lines
851 B
C

/******************************************************************************
* 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);
bool IsOK(OpRes& res);
bool Failed(OpRes&& res);
bool Failed(OpRes& res);
}
#endif // _OPERATION_RESULT_H_