LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
errors.hpp File Reference
#include <cstdint>
#include <LIEF/third-party/expected.hpp>
Include dependency graph for errors.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LIEF::ok_t
 Opaque structure used by ok_error_t. More...
 

Namespaces

namespace  LIEF
 LIEF namespace.
 

Typedefs

template<typename T >
using LIEF::result = tl::expected<T, lief_errors>
 Wrapper that contains an Object (T) or an error.
 
using LIEF::ok_error_t = result<ok_t>
 Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead, it makes the output explicit such as:
 

Enumerations

enum class  lief_errors : uint32_t {
  read_error = 1 , not_found , not_implemented , not_supported ,
  corrupted , conversion_error , read_out_of_bound , asn1_bad_tag ,
  file_error , file_format_error , parsing_error , build_error ,
  data_too_large , require_extended_version
}
 LIEF error codes definition. More...
 

Functions

const char * to_string (lief_errors err)
 
tl::unexpected< lief_errorsmake_error_code (lief_errors e)
 Create an standard error code from lief_errors.
 
template<class T >
lief_errors LIEF::get_error (result< T > &err)
 Get the error code associated with the result.
 
template<class T >
lief_errors LIEF::as_lief_err (result< T > &err)
 Return the lief_errors when the provided result<T> is an error.
 
ok_t LIEF::ok ()
 Return success for function with return type ok_error_t.
 
bool LIEF::is_ok (const ok_error_t &val)
 
bool LIEF::is_err (const ok_error_t &val)
 

Enumeration Type Documentation

◆ lief_errors

enum class lief_errors : uint32_t
strong

LIEF error codes definition.

Enumerator
read_error 
not_found 
not_implemented 
not_supported 
corrupted 
conversion_error 
read_out_of_bound 
asn1_bad_tag 
file_error 
file_format_error 
parsing_error 
build_error 
data_too_large 
require_extended_version 

Function Documentation

◆ make_error_code()

◆ to_string()

const char * to_string ( lief_errors err)