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

Growable character-container sink adapter. More...

#include "../microfmt.hpp"
#include <cstddef>
#include <new>
#include <reloco/allocator.hpp>
#include <reloco/error.hpp>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for container_sink.hpp:

Go to the source code of this file.

Classes

struct  microfmt::detail::has_data_size_impl< Container, typename >
 
struct  microfmt::detail::has_data_size_impl< Container, std::void_t< decltype(std::declval< Container & >().data()), decltype(std::declval< Container & >().size())> >
 
struct  microfmt::detail::has_std_push_back< Container, typename >
 
struct  microfmt::detail::has_std_push_back< Container, std::void_t< decltype(std::declval< Container & >().push_back(char{}))> >
 
struct  microfmt::detail::has_try_push_back< Container, typename >
 
struct  microfmt::detail::has_try_push_back< Container, std::void_t< decltype(static_cast< bool >(std::declval< Container & >().try_push_back(char{})))> >
 
struct  microfmt::detail::has_try_append< Container, typename >
 
struct  microfmt::detail::has_try_append< Container, std::void_t< decltype(static_cast< bool >(std::declval< Container & >().try_append(microfmt::string_view{})))> >
 
struct  microfmt::detail::is_growable_char_container_impl< Container >
 
struct  microfmt::detail::has_append< Container, typename >
 
struct  microfmt::detail::has_append< Container, std::void_t< decltype(std::declval< Container & >().append(std::declval< const char * >(), std::declval< std::size_t >()))> >
 
struct  microfmt::detail::has_range_insert< Container, typename >
 
struct  microfmt::detail::has_range_insert< Container, std::void_t< decltype(std::declval< Container & >().insert(std::declval< Container & >().end(), std::declval< const char * >(), std::declval< const char * >()))> >
 
class  microfmt::container_sink< Container, type >
 

Namespaces

namespace  microfmt
 
namespace  microfmt::detail
 

Functions

template<typename Container , typename std::enable_if< is_growable_char_container< Container >, int >::type = 0>
constexpr auto microfmt::make_container_sink (Container &c RELOCO_LIFETIMEBOUND) noexcept
 
template<typename Container , typename... Args>
RELOCO_BEGIN_UNSAFE_CODE std::enable_if< is_growable_char_container< Container >, void >::type microfmt::format_to_container (Container &dest, microfmt::string_view fmt_str, const Args &...args)
 
template<typename Container = std::string, typename... Args>
RELOCO_END_UNSAFE_CODE std::enable_if< is_growable_char_container< Container >, Container >::type microfmt::format_as_container (microfmt::string_view fmt_str, const Args &...args)
 
template<typename Container , typename... Args>
std::enable_if< is_growable_char_container< Container > &&std::is_constructible< Container, reloco::allocator_ref >::value, reloco::result< Container > >::type microfmt::try_format_as_container (reloco::allocator_ref alloc, microfmt::string_view fmt_str, const Args &...args)
 
template<typename Container , typename... Args>
std::enable_if< is_growable_char_container< Container >, reloco::result< void > >::type microfmt::try_format_to_container (Container &dest, microfmt::string_view fmt_str, const Args &...args)
 

Variables

template<typename Container >
constexpr bool microfmt::is_growable_char_container = detail::is_growable_char_container_impl<Container>::value
 

Detailed Description

Growable character-container sink adapter.