Merge orbis-kernel submodule

This commit is contained in:
Ivan Chikish 2023-07-03 14:10:16 +03:00
parent 91f48cdf77
commit 1ee6b7c970
97 changed files with 8134 additions and 1 deletions

View file

@ -0,0 +1,22 @@
#pragma once
namespace orbis {
enum class ErrorCode : int;
class SysResult {
int mValue = 0;
public:
SysResult() = default;
SysResult(ErrorCode ec) : mValue(-static_cast<int>(ec)){}
[[nodiscard]] static SysResult notAnError(ErrorCode ec) {
SysResult result;
result.mValue = static_cast<int>(ec);
return result;
}
[[nodiscard]] int value() const { return mValue < 0 ? -mValue : mValue; }
[[nodiscard]] bool isError() const { return mValue < 0; }
};
} // namespace orbis