Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::StringSink< Chunks > Struct Template Reference

Sink that stores streamed chunks until a string is actually needed. More...

#include <StringSink.hpp>

Public Member Functions

constexpr StringSink (::mundy::tuple< Chunks... > input_chunks)
template<impl::SinkChunk T>
constexpr auto operator<< (T &&rhs) const
std::string to_string () const
constexpr auto to_string_literal () const
Equality operators
template<size_t OtherSize>
constexpr bool operator== (const char(&other)[OtherSize]) const
template<size_t OtherSize>
bool operator== (const char(&other)[OtherSize]) const
template<size_t OtherSize>
constexpr bool operator== (const StringLiteralSink< OtherSize > &other) const
template<size_t OtherSize>
bool operator== (const StringLiteralSink< OtherSize > &other) const
template<size_t OtherSize>
constexpr bool operator== (const StringLiteral< OtherSize > &other) const
template<size_t OtherSize>
bool operator== (const StringLiteral< OtherSize > &other) const
template<typename... OtherChunks>
constexpr bool operator== (const StringSink< OtherChunks... > &other) const
template<typename... OtherChunks>
bool operator== (const StringSink< OtherChunks... > &other) const
bool operator== (const std::string &other) const

Public Attributes

::mundy::tuple< Chunks... > chunks

Static Public Attributes

static constexpr bool is_compile_time = (is_our_string_literal_v<Chunks> && ...)

Detailed Description

template<typename... Chunks>
struct mundy::StringSink< Chunks >

StringSink is the chunked counterpart to StringLiteralSink. It stores each chunk by value and only joins them into a single std::string when to_string() or operator<< is used. If every stored chunk is a mundy::StringLiteral, it can also be collapsed to a StringLiteral at compile time.

Constructor & Destructor Documentation

◆ StringSink()

template<typename... Chunks>
mundy::StringSink< Chunks >::StringSink ( ::mundy::tuple< Chunks... > input_chunks)
inlineexplicitconstexpr

Member Function Documentation

◆ operator<<()

template<typename... Chunks>
template<impl::SinkChunk T>
auto mundy::StringSink< Chunks >::operator<< ( T && rhs) const
constexpr

◆ to_string()

template<typename... Chunks>
std::string mundy::StringSink< Chunks >::to_string ( ) const
inline

◆ to_string_literal()

template<typename... Chunks>
auto mundy::StringSink< Chunks >::to_string_literal ( ) const
inlineconstexpr

◆ operator==() [1/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const char(&) other[OtherSize]) const
inlineconstexpr

◆ operator==() [2/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const char(&) other[OtherSize]) const
inline

◆ operator==() [3/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const StringLiteralSink< OtherSize > & other) const
inlineconstexpr

◆ operator==() [4/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const StringLiteralSink< OtherSize > & other) const
inline

◆ operator==() [5/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const StringLiteral< OtherSize > & other) const
inlineconstexpr

◆ operator==() [6/9]

template<typename... Chunks>
template<size_t OtherSize>
bool mundy::StringSink< Chunks >::operator== ( const StringLiteral< OtherSize > & other) const
inline

◆ operator==() [7/9]

template<typename... Chunks>
template<typename... OtherChunks>
bool mundy::StringSink< Chunks >::operator== ( const StringSink< OtherChunks... > & other) const
inlineconstexpr

◆ operator==() [8/9]

template<typename... Chunks>
template<typename... OtherChunks>
bool mundy::StringSink< Chunks >::operator== ( const StringSink< OtherChunks... > & other) const
inline

◆ operator==() [9/9]

template<typename... Chunks>
bool mundy::StringSink< Chunks >::operator== ( const std::string & other) const
inline

Member Data Documentation

◆ is_compile_time

template<typename... Chunks>
bool mundy::StringSink< Chunks >::is_compile_time = (is_our_string_literal_v<Chunks> && ...)
staticconstexpr

◆ chunks

template<typename... Chunks>
::mundy::tuple<Chunks...> mundy::StringSink< Chunks >::chunks