HikoGUI
A low latency retained GUI
|
#include <hikogui/utility/fixed_string.hpp>
Public Types | |
using | value_type = char |
Public Member Functions | |
constexpr | fixed_string (fixed_string const &) noexcept=default |
constexpr | fixed_string (fixed_string &&) noexcept=default |
constexpr fixed_string & | operator= (fixed_string const &) noexcept=default |
constexpr fixed_string & | operator= (fixed_string &&) noexcept=default |
template<std::size_t O> requires ((O - 1) == N) | |
constexpr | fixed_string (char const (&str)[O]) noexcept |
template<std::invocable F> | |
constexpr | fixed_string (F const &f) noexcept |
Create a fixed string from function returning a string-like. | |
constexpr | operator std::string_view () const noexcept |
constexpr | operator std::string () const noexcept |
constexpr std::size_t | size () const noexcept |
constexpr bool | empty () const noexcept |
constexpr char & | operator[] (size_t index) noexcept |
constexpr char const & | operator[] (size_t index) const noexcept |
constexpr auto | begin () noexcept |
constexpr auto | end () noexcept |
constexpr bool | operator== (fixed_string const &rhs) const noexcept=default |
constexpr auto | operator<=> (fixed_string const &rhs) const noexcept=default |
template<size_t O> requires (O != N) | |
constexpr bool | operator== (fixed_string< O > const &rhs) const noexcept |
template<size_t O> requires (O != N) | |
constexpr auto | operator<=> (fixed_string< O > const &rhs) const noexcept |
constexpr bool | operator== (std::string_view rhs) const noexcept |
constexpr auto | operator<=> (std::string_view rhs) const noexcept |
constexpr bool | operator== (std::string const &rhs) const noexcept |
constexpr auto | operator<=> (std::string const &rhs) const noexcept |
constexpr bool | operator== (char const *rhs) const noexcept |
constexpr auto | operator<=> (char const *rhs) const noexcept |
template<size_t O> | |
constexpr bool | operator== (char const (&rhs)[O]) const noexcept |
template<size_t O> | |
constexpr auto | operator<=> (char const (&rhs)[O]) const noexcept |
template<size_t R> | |
constexpr auto | operator+ (fixed_string< R > const &rhs) const noexcept |
Append two strings. | |
template<size_t R> | |
constexpr auto | operator+ (char const (&rhs)[R]) const noexcept |
template<size_t R> | |
constexpr auto | operator/ (fixed_string< R > const &rhs) const noexcept |
Join two strings with a slash '/'. | |
template<size_t R> | |
constexpr auto | operator/ (char const (&rhs)[R]) const noexcept |
Data Fields | |
std::array< char, N > | _str = {} |
Friends | |
template<size_t I> | |
constexpr friend char & | get (fixed_string &a) noexcept |
template<size_t I> | |
constexpr friend char const & | get (fixed_string const &a) noexcept |
A string which may be used as a none-type template parameter.
example: ``` template<hi::fixed_string Foo> class A { auto bar() { return std::string{Foo}; } };
std::string test() { auto a = A<"hello">{}; return a.bar(); } ```
|
inlineconstexprnoexcept |
Create a fixed string from function returning a string-like.
|
inlineconstexprnoexcept |
Append two strings.
|
inlineconstexprnoexcept |
Join two strings with a slash '/'.
If one or both of the operands is empty, no '/' is added.