Standard Library¶
The Pattern Language Standard Library is a set of utility functions and intrinsics to interact with ImHex or the currently loaded data.
Note
To use the Standard Library, it first needs to be installed. The easiest way to do that is through the Content Store under Help -> Content Store
.
Select the Libraries
tab and install std
from there.
Libraries¶
Bit Operations
1.10.1C Types
1.10.1Character Type Library
1.10.1- Functions
std::ctype::isdigit(char c) -> bool
1.10.1std::ctype::isxdigit(char c) -> bool
1.10.1std::ctype::isupper(char c) -> bool
1.10.1std::ctype::islower(char c) -> bool
1.10.1std::ctype::isalpha(char c) -> bool
1.10.1std::ctype::isalnum(char c) -> bool
1.10.1std::ctype::isspace(char c) -> bool
1.10.1std::ctype::isblank(char c) -> bool
1.10.1std::ctype::isprint(char c) -> bool
1.10.1std::ctype::iscntrl(char c) -> bool
1.10.1std::ctype::isgraph(char c) -> bool
1.10.1std::ctype::ispunct(char c) -> bool
1.10.1
- Functions
File I/O Library
1.12.0- Types
- Functions
std::file::open(str path, std::file::Mode mode) -> std::file::Handle
1.12.0std::file::close(std::file::Handle handle)
1.12.0std::file::read(std::file::Handle handle, u128 size) -> str
1.12.0std::file::write(std::file::Handle handle, str data)
1.12.0std::file::seek(std::file::Handle handle, u128 offset)
1.12.0std::file::size(std::file::Handle handle) -> u128
1.12.0std::file::resize(std::file::Handle handle, u128 size)
1.12.0std::file::flush(std::file::Handle handle)
1.12.0std::file::remove(std::file::Handle handle)
1.12.0
Fixed-point Library
1.10.1- Types
- Functions
std::fxpt::to_float(fixed fxt, u32 precision) -> double
1.10.1std::fxpt::to_fixed(double flt, u32 precision) -> fixed
1.10.1std::fxpt::change_precision(fixed value, u32 start_precision, u32 end_precision) -> fixed
1.10.1std::fxpt::add(fixed a, fixed b, u32 precision) -> fixed
1.10.1std::fxpt::subtract(fixed a, fixed b, u32 precision) -> fixed
1.10.1std::fxpt::multiply(fixed a, fixed b, u32 precision) -> fixed
1.10.1std::fxpt::divide(fixed a, fixed b, u32 precision) -> fixed
1.10.1
Networking Library
1.10.1Console I/O Library
Numeric Limits Library
1.10.1- Functions
std::limits::u8_min() -> u8
1.10.1std::limits::u8_max() -> u8
1.10.1std::limits::u16_min() -> u16
1.10.1std::limits::u16_max() -> u16
1.10.1std::limits::u32_min() -> u32
1.10.1std::limits::u32_max() -> u32
1.10.1std::limits::u64_min() -> u64
1.10.1std::limits::u64_max() -> u64
1.10.1std::limits::u128_min() -> u128
1.10.1std::limits::u128_max() -> u128
1.10.1std::limits::s8_min() -> s8
1.10.1std::limits::s8_max() -> s8
1.10.1std::limits::s16_min() -> s16
1.10.1std::limits::s16_max() -> s16
1.10.1std::limits::s32_min() -> s32
1.10.1std::limits::s32_max() -> s32
1.10.1std::limits::s64_min() -> s64
1.10.1std::limits::s64_max() -> s64
1.10.1std::limits::s128_min() -> s128
1.10.1std::limits::s128_max() -> s128
1.10.1
- Functions
Math Library
1.10.1- Functions
std::math::min(auto a, auto b) -> auto
1.10.1std::math::max(auto a, auto b) -> auto
1.10.1std::math::clamp(auto x, auto min, auto max) -> auto
1.10.1std::math::abs(auto x) -> auto
1.10.1std::math::sign(auto x) -> auto
1.10.1std::math::copy_sign(auto x, auto y) -> auto
1.10.1std::math::factorial(auto x) -> auto
1.10.1std::math::comb(u128 n, u128 k) -> u128
1.10.1std::math::perm(u128 n, u128 k) -> u128
1.10.1std::math::floor(auto value) -> auto
1.14.0std::math::ceil(auto value) -> auto
1.14.0std::math::round(auto value) -> auto
1.14.0std::math::trunc(auto value) -> auto
1.14.0std::math::log10(auto value) -> auto
1.14.0std::math::log2(auto value) -> auto
1.14.0std::math::ln(auto value) -> auto
1.14.0std::math::fmod(auto x, auto y) -> auto
1.14.0std::math::pow(auto base, auto exp) -> auto
1.14.0std::math::sqrt(auto value) -> auto
1.14.0std::math::cbrt(auto value) -> auto
1.14.0std::math::sin(auto value) -> auto
1.14.0std::math::cos(auto value) -> auto
1.14.0std::math::tan(auto value) -> auto
1.14.0std::math::asin(auto value) -> auto
1.14.0std::math::acos(auto value) -> auto
1.14.0std::math::atan(auto value) -> auto
1.14.0std::math::sinh(auto value) -> auto
1.14.0std::math::cosh(auto value) -> auto
1.14.0std::math::tanh(auto value) -> auto
1.14.0std::math::asinh(auto value) -> auto
1.14.0std::math::acosh(auto value) -> auto
1.14.0std::math::atanh(auto value) -> auto
1.14.0
- Functions
Memory Library
- Functions
std::mem::align_to(u128 alignment, u128 value) -> u128
std::mem::base_address() -> u128
std::mem::size() -> u128
std::mem::find_sequence(u128 occurence_index, u8 bytes...) -> u128
std::mem::read_unsigned(u128 address, u128 size) -> u128
std::mem::read_signed(u128 address, u128 size) -> s128
std::mem::read_string(u128 address, u128 size) -> str
std::mem::eof() -> bool
1.11.0
- Functions
Pointer Support Library
1.10.1Rust Types
1.10.1String Library
1.10.1- Functions
std::string::length(str string) -> u128
std::string::at(str string, u128 index) -> char
std::string::substr(str string, u128 pos, u128 size) -> str
std::string::parse_int(str string, u128 base) -> s128
1.10.1std::string::parse_float(str string) -> double
1.10.1std::string::to_string(auto x) -> str
1.10.1std::string::starts_with(str string, str part) -> bool
1.10.1std::string::ends_with(str string, str part) -> bool
1.10.1std::string::contains(str a, str b) -> bool
1.10.1std::string::reverse(str string) -> str
1.12.0
- Functions
Language System Library
1.10.1