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);
36inline uint64_t
align_down(uint64_t value, uint64_t align_on) {
40 const auto r = value % align_on;
68constexpr size_t operator ""_KB(
unsigned long long kbs)
73constexpr size_t operator ""_MB(
unsigned long long mbs)
75 return 1024LLU * 1024LLU * mbs;
78constexpr size_t operator ""_GB(
unsigned long long gbs)
80 return 1024LLU * 1024LLU * 1024LLU * gbs;
82LIEF_API std::string
u16tou8(
const std::u16string&
string,
bool remove_null_char =
false);
LIEF namespace.
Definition Abstract/Binary.hpp:36
std::string extended_version_info()
Details about the extended version.
uint64_t align(uint64_t value, uint64_t align_on)
Definition utils.hpp:25
uint64_t align_down(uint64_t value, uint64_t align_on)
Definition utils.hpp:36
uint64_t round< uint64_t >(uint64_t x)
Definition utils.hpp:54
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:48
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