19#include <LIEF/third-party/expected.hpp>
52 return tl::make_unexpected(e);
74using result = tl::expected<T, lief_errors>;
111 return val.has_value();
lief_errors
LIEF error codes definition.
Definition errors.hpp:23
tl::unexpected< lief_errors > make_error_code(lief_errors e)
Create an standard error code from lief_errors.
Definition errors.hpp:51
const char * to_string(lief_errors err)
LIEF namespace.
Definition Abstract/Binary.hpp:32
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:108
bool is_ok(const ok_error_t &val)
Definition errors.hpp:110
lief_errors get_error(result< T > &err)
Get the error code associated with the result.
Definition errors.hpp:78
ok_t ok()
Return success for function with return type ok_error_t.
Definition errors.hpp:92
bool is_err(const ok_error_t &val)
Definition errors.hpp:114
lief_errors as_lief_err(result< T > &err)
Return the lief_errors when the provided result<T> is an error.
Definition errors.hpp:84
tl::expected< T, lief_errors > result
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:74
Opaque structure used by ok_error_t.
Definition errors.hpp:89