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

`std::basic_string` and advanced string formatting views (fill, align, width, precision, debug escaping). More...

#include "../microfmt.hpp"
#include <cstddef>
#include <string>
#include <string_view>
Include dependency graph for string.hpp:

Go to the source code of this file.

Classes

struct  microfmt::formatter< std::basic_string< CharT, Traits, Alloc > >
 Formatter for std::basic_string / std::basic_string_view values. More...
 
struct  microfmt::detail::parsed_string_spec
 Parsed advanced string format specifier state. More...
 
class  microfmt::as_string_view
 Non-owning string view supporting advanced format specifiers. More...
 
struct  microfmt::formatter< as_string_view >
 Formatter for as_string_view supporting fill, alignment, width, precision, and debug escaping. More...
 

Namespaces

namespace  microfmt
 
namespace  microfmt::detail
 

Enumerations

enum class  microfmt::detail::string_align : uint8_t { microfmt::detail::none , microfmt::detail::left , microfmt::detail::right , microfmt::detail::center }
 Horizontal alignment mode for padded string output. More...
 

Functions

RELOCO_BEGIN_UNSAFE_CODE constexpr parsed_string_spec microfmt::detail::parse_advanced_string_spec (microfmt::string_view spec) noexcept
 Parses an advanced string specifier: [[fill]align][width][.precision][?].
 
RELOCO_END_UNSAFE_CODE void microfmt::detail::write_fill_chars (const sink &out, char fill, size_t count) noexcept
 Writes count copies of fill to the sink in bounded chunks.
 
void microfmt::detail::write_escaped_character (const sink &out, char ch) noexcept
 Writes a single character with C-style debug escaping.
 
size_t microfmt::detail::calculate_escaped_len (microfmt::string_view sv) noexcept
 Computes the rendered character count of a debug-escaped string.
 
constexpr as_string_view microfmt::as_string (microfmt::string_view sv) noexcept
 Wraps a string_view for advanced string formatting.
 
template<typename CharT , typename Traits , typename Alloc >
as_string_view microfmt::as_string (const std::basic_string< CharT, Traits, Alloc > &str) noexcept
 Wraps a std::basic_string for advanced string formatting.
 
template<typename CharT , typename Traits , typename Alloc >
as_string_view microfmt::as_string (std::basic_string< CharT, Traits, Alloc > &&) noexcept=delete
 
RELOCO_BEGIN_UNSAFE_CODE constexpr as_string_view microfmt::as_string (const char *str) noexcept
 Wraps a null-terminated C string for advanced string formatting.
 

Detailed Description

`std::basic_string` and advanced string formatting views (fill, align, width, precision, debug escaping).