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 | |
| text () | |
| Default constructor. | |
| template<std::size_t N> | |
| text (char const (&data)[N]) | |
| Construct from fixed-size C-style string. | |
| 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) | |
| Move constructor. | |
| text (text const &other) | |
| Copy constructor. | |
| ~text () | |
| Destructor. | |
| 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 * | data () |
| Get a pointer to the underlying character data. | |
| 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) |
| Move assignment operator. | |
| text & | operator= (text const &other) |
| Copy assignment operator. | |
| int | size () const |
| Get the size of the text. | |
| void | swap (text &o) |
| Swap contents with another text instance. | |
Friends | |
| template<_::stream 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. | |
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 |