|
VLink
2.0.0
A high-performance communication middleware
|
Minimal allocation-free {} placeholder formatter.
More...
Namespaces | |
| detail | |
Classes | |
| struct | FString |
| Compile-time format-string wrapper carrying the expected argument list. More... | |
| struct | FormatToNResult |
Return type of format_to_n; carries the end iterator, total size and truncation flag. More... | |
| struct | FormatToResult |
Return type of the fixed-array format_to overload. More... | |
Typedefs | |
| template<typename... ArgsT> | |
| using | format_string = typename FString< ArgsT... >::t |
| Convenience alias used as the formal type of format-string parameters. More... | |
Functions | |
| template<typename... ArgsT> | |
| detail::FormatArgStore< char, detail::RemoveCvref< ArgsT >... > | make_format_args (const ArgsT &... args) |
| Public API. More... | |
| template<typename... ArgsT> | |
| FormatToNResult< char * > | format_to_n (char *out, size_t n, format_string< ArgsT... > fmt, const ArgsT &... args) |
Formats args into out, writing at most n characters. More... | |
| template<size_t NumT, typename... ArgsT> | |
| FormatToResult | format_to (char(&out)[NumT], format_string< ArgsT... > fmt, const ArgsT &... args) |
Formats args into a fixed-size character array; equivalent to format_to_n. More... | |
| template<typename OutputItT , typename... ArgsT, std::enable_if_t< detail::kIsOutputIterator< detail::RemoveCvref< OutputItT >> &&!std::is_array_v< std::remove_reference_t< OutputItT >>, int > = 0> | |
| detail::RemoveCvref< OutputItT > | format_to (OutputItT &&out, format_string< ArgsT... > fmt, const ArgsT &... args) |
Formats args through an output iterator. More... | |
Minimal allocation-free {} placeholder formatter.
| using vlink::format::format_string = typedef typename FString<ArgsT...>::t |
Convenience alias used as the formal type of format-string parameters.
| ArgsT | Expected argument types. |
|
inline |
Formats args into a fixed-size character array; equivalent to format_to_n.
| NumT | Array size (deduced). |
| ArgsT | Argument types. |
| out | Destination array. |
| fmt | Format string. |
| args | Arguments to substitute. |
FormatToResult describing the end pointer, total size and truncation flag.
|
inline |
Formats args through an output iterator.
Writes each character via *out++ = c. The iterator must satisfy the OutputIterator concept; arrays are explicitly excluded so the fixed-array overload wins overload resolution.
| OutputItT | Output iterator type. |
| ArgsT | Argument types. |
| out | Destination iterator. |
| fmt | Format string. |
| args | Arguments to substitute. |
|
inline |
Formats args into out, writing at most n characters.
Placeholders in fmt are substituted with args in order. When the produced text would exceed n the output is truncated and truncated is set to true. The caller is responsible for null termination if needed.
| ArgsT | Argument types (deduced). |
| out | Destination buffer with capacity of at least n bytes. |
| n | Maximum characters to write, not counting a null terminator. |
| fmt | Format string with {} placeholders. |
| args | Arguments to substitute. |
FormatToNResult describing the end iterator, total size and truncation flag.
|
inline |
Public API.
Builds a type-erased argument store from a parameter pack.
| ArgsT | Argument types. |
| args | Argument values. |