19#include <LIEF/third-party/expected.hpp>
53 return tl::make_unexpected(e);
75using result = tl::expected<T, lief_errors>;
112 return val.has_value();
lief_errors
LIEF error codes definition.
Definition errors.hpp:23
@ require_extended_version
Definition errors.hpp:41
@ file_format_error
Definition errors.hpp:36
@ data_too_large
Definition errors.hpp:40
@ read_out_of_bound
Definition errors.hpp:32
@ conversion_error
Definition errors.hpp:30
@ build_error
Definition errors.hpp:38
@ not_implemented
Definition errors.hpp:26
@ not_found
Definition errors.hpp:25
@ corrupted
Definition errors.hpp:29
@ asn1_bad_tag
Definition errors.hpp:33
@ not_supported
Definition errors.hpp:27
@ read_error
Definition errors.hpp:24
@ parsing_error
Definition errors.hpp:37
@ file_error
Definition errors.hpp:34
tl::unexpected< lief_errors > make_error_code(lief_errors e)
Create an standard error code from lief_errors.
Definition errors.hpp:52
const char * to_string(lief_errors err)
LIEF namespace.
Definition Abstract/Binary.hpp:40
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:109
bool is_ok(const ok_error_t &val)
Definition errors.hpp:111
lief_errors get_error(result< T > &err)
Get the error code associated with the result.
Definition errors.hpp:79
ok_t ok()
Return success for function with return type ok_error_t.
Definition errors.hpp:93
bool is_err(const ok_error_t &val)
Definition errors.hpp:115
lief_errors as_lief_err(result< T > &err)
Return the lief_errors when the provided result<T> is an error.
Definition errors.hpp:85
tl::expected< T, lief_errors > result
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:75
Opaque structure used by ok_error_t.
Definition errors.hpp:90