|
TTS v4.0.0
The Tiny Test System
|
Lightweight string-like object. More...
Lightweight string-like object.
tts::text is a simple string-like object that can be used to represent and manipulate text data in TTS. It provides basic functionalities such as construction from formatted strings, concatenation, and stream output support
Public Member Functions | |
| decltype(auto) | begin () |
| Get an iterator to the beginning of the text. | |
| decltype(auto) | begin () const |
| Get a const iterator to the beginning of the text. | |
| char const * | data () const |
| decltype(auto) | end () |
| Get an iterator to the end of the text. | |
| decltype(auto) | end () const |
| Get a const iterator to the end of the text. | |
| bool | is_empty () const |
| Check if the text is empty. | |
| text | operator+ (text const &other) const |
| Concatenate and return a new text instance. | |
| text & | operator+= (char const *other) |
| Concatenate a C-style string. | |
| text & | operator+= (text const &other) |
| Concatenate another text instance. | |
| text & | operator= (text &&other) noexcept |
| Move assignment operator. | |
| text & | operator= (text const &other) |
| Copy assignment operator. | |
| size_t | size () const |
| Get the size of the text. | |
| void | swap (text &o) noexcept |
| Swap contents with another text instance. | |
| text ()=default | |
| Default constructor. | |
| template<typename... Args> | |
| text (char const *format, Args... args) | |
| Construct from formatted string. | |
| text (char const *ptr) | |
| Construct from C-style string. | |
| text (text &&other) noexcept | |
| Move constructor. | |
| text (text const &other) | |
| Copy constructor. | |
| ~text () | |
| Destructor. | |
Friends | |
| template<tts_implementation_defined OS> | |
| OS & | operator<< (OS &os, text const &t) |
| Stream output operator. | |
| template<std::size_t N> | |
| auto | operator<=> (text const &a, char const (&b)[N]) noexcept |
| Three-way comparison operator with C-style string. | |
| std::strong_ordering | operator<=> (text const &a, text const &b) noexcept |
| Three-way comparison operator with other text instance. | |
| template<std::size_t N> | |
| bool | operator== (text const &a, char const (&b)[N]) noexcept |
| Equality comparison operator with C-style string. | |
| bool | operator== (text const &a, text const &b) noexcept |
| Equality comparison operator. | |
|
inlineexplicit |
Construct from formatted string.
tts::text is constructible from a C-style format string and a variable number of arguments.
| format | C-style format string |
| args | Arguments to format according to format |
|
inlinenodiscard |
Get a pointer to the constant underlying character data Returns an empty string literal if data_ is null to prevent s crashes