Template class for non-alloc strings. More...
#include <fixed_size_string.hpp>
Public Member Functions | |
| fixed_string () noexcept | |
| Default constructor. More... | |
| fixed_string (const char *c_array, size_t n_chars) noexcept | |
| Constructs from a char array. More... | |
| fixed_string & | assign (const char *c_array, size_t n_chars) noexcept |
| Assigns from a char array. More... | |
| fixed_string (const char *c_string) noexcept | |
| Constructs from a C string. More... | |
| fixed_string & | operator= (const char *c_string) noexcept |
| Assigns from a C string. More... | |
| fixed_string (const std::string &str) noexcept | |
| Constructs from a std::string. More... | |
| fixed_string & | operator= (const std::string &str) noexcept |
| Assigns from a std::string. More... | |
| template<size_t N> | |
| fixed_string & | operator= (const fixed_string< N > &rhs) noexcept |
| Assigns from a fixed_string of any size. More... | |
| const char * | c_str () const noexcept |
| Converts to C string. More... | |
| std::string | to_string () const |
| Converts to std::string. More... | |
| bool | operator== (const char *rhs) const noexcept |
| Compares equality with a C string. More... | |
| bool | operator== (const std::string &rhs) const noexcept |
| Compares equality with a std::string. More... | |
| template<size_t N> | |
| bool | operator== (const fixed_string< N > &rhs) const noexcept |
| Compares equality with a fixed_string of any size. More... | |
| bool | operator!= (const char *rhs) const noexcept |
| Compares inequality with a C string. More... | |
| bool | operator!= (const std::string &rhs) const noexcept |
| Compares inequality with a std::string. More... | |
| template<size_t N> | |
| bool | operator!= (const fixed_string< N > &rhs) const noexcept |
| Compares inequality with a fixed_string of any size. More... | |
| template<size_t N> | |
| bool | operator< (const fixed_string< N > &rhs) const noexcept |
| Compares relational less than with a fixed_string of any size. More... | |
| template<size_t N> | |
| bool | operator> (const fixed_string< N > &rhs) const noexcept |
| Compares relational greater than with a fixed_string of any size. More... | |
| bool | operator< (const std::string &rhs) const noexcept |
| Compares relational less than with a std::string of any size. More... | |
| bool | operator> (const std::string &rhs) const noexcept |
| Compares relational greater than with a std::string of any size. More... | |
| operator const char * () const noexcept | |
| Casts to a C string. More... | |
| size_t | size () const noexcept |
| Returns the size of the string. More... | |
| int | compare (const char *str) const noexcept |
| Compares with a C string. More... | |
| int | compare (const std::string &str) const noexcept |
| Compares with a std::string. More... | |
| template<size_t N> | |
| int | compare (const fixed_string< N > &str) const noexcept |
| Compares with a fixed_string. More... | |
Static Public Attributes | |
| static constexpr size_t | max_size = MAX_CHARS |
| Maximum number of characters. More... | |
Template class for non-alloc strings.
Will be truncated when assigned from a longer string.
| MAX_CHARS | Maximum number of characters is specified as the template parameter. Space for an additional null terminator will be reserved. |
|
inlinenoexcept |
Default constructor.
|
inlinenoexcept |
Constructs from a char array.
| [in] | c_array | Char array to be constructed from. |
| [in] | n_chars | Number of characters of the Char array |
|
inlinenoexcept |
Constructs from a C string.
| [in] | c_string | Pointer to the C string. |
|
inlinenoexcept |
Constructs from a std::string.
| [in] | str | Reference to the std::string. |
|
inlinenoexcept |
Assigns from a char array.
| [in] | c_array | Char array to be assigned from. |
| [in] | n_chars | Number of characters of the Char array. |
|
inlinenoexcept |
Converts to C string.
|
inlinenoexcept |
Compares with a C string.
| [in] | str | C string to be compared with. |
std::string::compare().
|
inlinenoexcept |
Compares with a fixed_string.
| [in] | str | fixed_string to be compared with. |
std::string::compare().
|
inlinenoexcept |
Compares with a std::string.
| [in] | str | std::string to be compared with. |
std::string::compare().
|
inlinenoexcept |
Casts to a C string.
|
inlinenoexcept |
Compares inequality with a C string.
| [in] | rhs | C string to be compared with. |
true if strings are not equal. false otherwise.
|
inlinenoexcept |
Compares inequality with a fixed_string of any size.
| [in] | rhs | fixed_string to be compared with. |
true if strings are not equal. false otherwise.
|
inlinenoexcept |
Compares inequality with a std::string.
| [in] | rhs | std::string to be compared with. |
true if strings are not equal. false otherwise.
|
inlinenoexcept |
Compares relational less than with a fixed_string of any size.
| [in] | rhs | fixed_string to be compared with. |
true if this string is less than the provided one. false otherwise.
|
inlinenoexcept |
Compares relational less than with a std::string of any size.
| [in] | rhs | std::string to be compared with. |
true if this string is less than the provided one. false otherwise.
|
inlinenoexcept |
Assigns from a C string.
| [in] | c_string | Pointer to the C string. |
|
inlinenoexcept |
Assigns from a fixed_string of any size.
| [in] | rhs | Reference to the fixed_string. return Reference of this instance. |
|
inlinenoexcept |
Assigns from a std::string.
| [in] | str | Reference to the std::string. return Reference of this instance. |
|
inlinenoexcept |
Compares equality with a C string.
| [in] | rhs | C string to be compared with. |
true if strings are equal. false otherwise.
|
inlinenoexcept |
Compares equality with a fixed_string of any size.
| [in] | rhs | fixed_string to be compared with. |
true if strings are equal. false otherwise.
|
inlinenoexcept |
Compares equality with a std::string.
| [in] | rhs | std::string to be compared with. |
true if strings are equal. false otherwise.
|
inlinenoexcept |
Compares relational greater than with a fixed_string of any size.
| [in] | rhs | fixed_string to be compared with. |
true if this string is greater than the provided one. false otherwise.
|
inlinenoexcept |
Compares relational greater than with a std::string of any size.
| [in] | rhs | std::string to be compared with. |
true if this string is greater than the provided one. false otherwise.
|
inlinenoexcept |
Returns the size of the string.
|
inline |
Converts to std::string.
|
staticconstexpr |
Maximum number of characters.