microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
format_helpers.hpp File Reference

Hexadecimal, byte, address, and alignment helpers. More...

#include "../microfmt.hpp"
Include dependency graph for format_helpers.hpp:

Go to the source code of this file.

Classes

struct  microfmt::hex_view< T >
 Explicitly formats an integer in hexadecimal or binary with customizable prefix, padding width, and case without altering string specifiers. More...
 
struct  microfmt::formatter< hex_view< T > >
 
struct  microfmt::bin_view< T >
 Explicit binary integer formatter (e.g. for bitfield and control register flags). More...
 
struct  microfmt::formatter< bin_view< T > >
 
struct  microfmt::bytes_view
 Automatically formats byte counts into human-readable units (B, KiB, MiB, GiB, TiB). More...
 
struct  microfmt::formatter< bytes_view >
 
struct  microfmt::addr_offset_view
 Formats an address with a base + offset view: 0x7fff0000+0x140 More...
 
struct  microfmt::formatter< addr_offset_view >
 
struct  microfmt::memory_range_view
 Formats an address range: [0x10000000..0x10004000] (16 KiB) More...
 
struct  microfmt::formatter< memory_range_view >
 
struct  microfmt::aligned_text_view
 
struct  microfmt::formatter< aligned_text_view >
 
struct  microfmt::joined_span_view< T >
 Formats a contiguous array/span of values separated by a custom delimiter. Example: join(span, ", ") -> 0x10, 0x20, 0x30 More...
 
struct  microfmt::formatter< joined_span_view< T > >
 

Namespaces

namespace  microfmt
 

Enumerations

enum class  microfmt::align_mode : uint8_t { microfmt::left , microfmt::right , microfmt::center }
 

Functions

template<typename T >
constexpr hex_view< T > microfmt::hex (T val, int width=0, bool prefix=false, bool uppercase=false) noexcept
 
template<typename T >
constexpr bin_view< T > microfmt::bin (T val, int width=sizeof(T) *8, bool prefix=false) noexcept
 
constexpr bytes_view microfmt::bytes (uint64_t count) noexcept
 
constexpr addr_offset_view microfmt::addr_offset (uintptr_t addr, uintptr_t base) noexcept
 
constexpr memory_range_view microfmt::mem_range (uintptr_t start, uintptr_t end) noexcept
 
constexpr aligned_text_view microfmt::align (microfmt::string_view text, size_t width, align_mode mode=align_mode::left, char pad_char=' ') noexcept
 
template<typename T >
constexpr joined_span_view< T > microfmt::join (span< const T > items, microfmt::string_view delim=", ") noexcept
 

Detailed Description

Hexadecimal, byte, address, and alignment helpers.