/****************************************************************************** * File - OpRes.cpp * 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. * ******************************************************************************/ #include "OpRes.h" namespace lunarium { bool OpRes::operator==(const OpRes& rhs) { return this->Type == rhs.Type; } bool OpRes::operator==(ResultType rhs) { return this->Type == rhs; } OpRes OpRes::OK() { return { ResultType::OK, "The operation succeeded" }; } OpRes OpRes::Fail(const char* why) { return { ResultType::FAIL, why }; } bool IsOK(OpRes&& res) { return res.Type == ResultType::OK; } bool Failed(OpRes&& res) { return res.Type == ResultType::FAIL; } }