microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Member Functions | List of all members
microfmt::remote_string_view Class Reference

Streaming view of a remote NUL-terminated string. More...

#include <address_space.hpp>

Public Member Functions

constexpr remote_string_view () noexcept=default
 Constructs an empty (null) view.
 
constexpr remote_string_view (uintptr_t addr, address_space_ref space, span< char > scratch RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS, size_t max_limit=4096) noexcept
 Constructs a view over a remote string.
 
template<size_t N>
constexpr remote_string_view (uintptr_t addr, address_space_ref space, char(&scratch RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS)[N], size_t max_limit=4096) noexcept
 Constructs a view over a remote string using a fixed C array as scratch.
 
constexpr uintptr_t address () const noexcept
 Returns the remote string address.
 
constexpr address_space_ref space () const noexcept
 Returns the address space handle.
 
constexpr span< char > scratch () const noexcept RELOCO_LIFETIMEBOUND
 Returns the scratch chunk buffer.
 
constexpr size_t max_limit () const noexcept
 Returns the maximum render length.
 

Detailed Description

Streaming view of a remote NUL-terminated string.

Pulls the string through a reusable scratch buffer in bounded chunks to keep stack usage minimal.

Constructor & Destructor Documentation

◆ remote_string_view() [1/3]

constexpr microfmt::remote_string_view::remote_string_view ( )
constexprdefaultnoexcept

Constructs an empty (null) view.

◆ remote_string_view() [2/3]

constexpr microfmt::remote_string_view::remote_string_view ( uintptr_t  addr,
address_space_ref  space,
span< char > scratch RELOCO_LIFETIMEBOUND  RELOCO_LIFETIME_CAPTURE_BY_THIS,
size_t  max_limit = 4096 
)
inlineconstexprnoexcept

Constructs a view over a remote string.

Parameters
addrAbsolute address of the string.
spaceAddress space the string lives in.
scratchReusable chunk-read buffer.
max_limitMaximum characters to render.

◆ remote_string_view() [3/3]

template<size_t N>
constexpr microfmt::remote_string_view::remote_string_view ( uintptr_t  addr,
address_space_ref  space,
char(&)  RELOCO_LIFETIME_CAPTURE_BY_THIS[N],
size_t  max_limit = 4096 
)
inlineconstexprnoexcept

Constructs a view over a remote string using a fixed C array as scratch.

Template Parameters
NSize of the scratch array.
Parameters
addrAbsolute address of the string.
spaceAddress space the string lives in.
scratchReusable chunk-read buffer.
max_limitMaximum characters to render.

Member Function Documentation

◆ address()

constexpr uintptr_t microfmt::remote_string_view::address ( ) const
inlineconstexprnoexcept

Returns the remote string address.

Returns
Absolute address, or 0 when null.

◆ max_limit()

constexpr size_t microfmt::remote_string_view::max_limit ( ) const
inlineconstexprnoexcept

Returns the maximum render length.

Returns
Character limit.

◆ scratch()

constexpr span< char > microfmt::remote_string_view::scratch ( ) const
inlineconstexprnoexcept

Returns the scratch chunk buffer.

Returns
Scratch span used for chunked reads.

◆ space()

constexpr address_space_ref microfmt::remote_string_view::space ( ) const
inlineconstexprnoexcept

Returns the address space handle.

Returns
Bound address_space_ref.

The documentation for this class was generated from the following file: