|
ReXGlue SDK
|
Go to the source code of this file.
Classes | |
| struct | rex::Error |
Namespaces | |
| namespace | rex |
Macros | |
| #define | REX_TRY_PASTE(a, b) |
| #define | REX_TRY_EXPAND_PASTE(a, b) |
| #define | REX_TRY(decl, expr) |
| #define | REX_TRY_VOID(expr) |
| #define | REX_ERROR_IF(cond, error) |
Typedefs | |
| template<typename T> | |
| using | rex::Result = std::expected<T, Error> |
Enumerations | |
| enum class | rex::ErrorCategory : u8 { kNoError , kIO , rex::kMemory , rex::kFormat , rex::kCrypto , kCompression , rex::kRuntime , kPlatform , kConfig , rex::kValidation , kNotFound , kNotImplemented , rex::kModule } |
Functions | |
| template<typename T> | |
| Result< T > | rex::Ok (T &&value) |
| Result< void > | rex::Ok () |
| template<typename T = void> | |
| auto | rex::Err (Error error) |
| template<typename T = void> | |
| auto | rex::Err (ErrorCategory category, std::string message, int code=0) |
| #define REX_ERROR_IF | ( | cond, | |
| error ) |
Returns an error from the enclosing function when a condition holds.
| error | The rex::Error to return when the condition is true. |
| #define REX_TRY | ( | decl, | |
| expr ) |
Unwraps a rex::Result into a declaration, or returns its error from the enclosing function.
It is a statement, not an expression.
| decl | The declaration that receives the value. |
| expr | An expression of type rex::Result<T>. |
| #define REX_TRY_EXPAND_PASTE | ( | a, | |
| b ) |
Pastes two tokens after expanding them, so __LINE__ becomes the line number.
| #define REX_TRY_PASTE | ( | a, | |
| b ) |
Pastes two tokens without expanding them first. Helper of REX_TRY_EXPAND_PASTE.
The example yields the token _rex_try_12.
| #define REX_TRY_VOID | ( | expr | ) |
Returns the error of a rex::Result expression from the enclosing function.
| expr | An expression of type rex::Result<T>, usually rex::Result<void>. |