16#ifndef LIEF_UTILS_HEADER
17#define LIEF_UTILS_HEADER
25inline uint64_t
align(uint64_t value, uint64_t align_on) {
29 const auto r = value % align_on;
31 return value + (align_on - r);
58constexpr size_t operator ""_KB(
unsigned long long kbs)
63constexpr size_t operator ""_MB(
unsigned long long mbs)
65 return 1024LLU * 1024LLU * mbs;
68constexpr size_t operator ""_GB(
unsigned long long gbs)
70 return 1024LLU * 1024LLU * 1024LLU * gbs;
72LIEF_API std::string
u16tou8(
const std::u16string&
string,
bool remove_null_char =
false);
LIEF namespace.
Definition Abstract/Binary.hpp:36
uint64_t align(uint64_t value, uint64_t align_on)
Definition utils.hpp:25
uint64_t round< uint64_t >(uint64_t x)
Definition utils.hpp:44
result< std::string > demangle(const std::string &mangled)
Demangle the given input.
result< std::u16string > u8tou16(const std::string &string)
Convert a UTF-8 string to a UTF-16 one.
bool is_extended()
Whether this version of LIEF includes extended features.
std::string u16tou8(const std::u16string &string, bool remove_null_char=false)
Convert a UTF-16 string to a UTF-8 one.
constexpr T round(T x)
Definition utils.hpp:38
tl::expected< T, lief_errors > result
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:75
#define LIEF_API
Definition visibility.h:41