string implementation with some adjustments in the API, because we are not allowed to throw exceptions or use heap. Please see iceoryx/iceoryx_utils/doc/fixedString.adoc for further information.
More...
|
constexpr | string () noexcept=default |
| creates an empty string with size 0
|
|
| string (const string &other) noexcept |
| copy constructor More...
|
|
| string (string &&other) noexcept |
| move constructor More...
|
|
string & | operator= (const string &rhs) noexcept |
| copy assignment More...
|
|
string & | operator= (string &&rhs) noexcept |
| move assignment More...
|
|
template<uint64_t N> |
| string (const string< N > &other) noexcept |
| creates a new string of given capacity as a copy of other with compile time check whether the capacity of other is less than or equal to this' capacity More...
|
|
template<uint64_t N> |
| string (string< N > &&other) noexcept |
| moves other to this with compile time check whether the capacity of other is less than or equal to this' capacity More...
|
|
template<uint64_t N> |
string & | operator= (const string< N > &rhs) noexcept |
| assigns rhs fixed string to this with compile time check whether the capacity of rhs is less than or equal to this' capacity More...
|
|
template<uint64_t N> |
string & | operator= (string< N > &&rhs) noexcept |
| moves rhs fixed string to this with compile time check whether the capacity of rhs is less than or equal to this' capacity More...
|
|
template<uint64_t N> |
| string (const char(&other)[N]) noexcept |
| conversion constructor for char array with compile time check if the array size is less than or equal to the string capacity More...
|
|
| string (TruncateToCapacity_t, const char *const other) noexcept |
| conversion constructor for cstring to string which truncates characters if the size is greater than the string capacity More...
|
|
| string (TruncateToCapacity_t, const std::string &other) noexcept |
| conversion constructor for std::string to string which truncates characters if the std::string size is greater than the string capacity More...
|
|
| string (TruncateToCapacity_t, const char *const other, const uint64_t count) noexcept |
| constructor from cstring to string. Constructs the string with the first count characters of the cstring including null characters. If count is greater than the string capacity the remainder of the characters are truncated. More...
|
|
template<uint64_t N> |
string & | operator= (const char(&rhs)[N]) noexcept |
| assigns a char array to string with compile time check if the array size is less than or equal to the string capacity More...
|
|
template<uint64_t N> |
string & | assign (const string< N > &str) noexcept |
| fixed string assignment with compile time check if capacity of str is less than or equal to this' capacity More...
|
|
template<uint64_t N> |
string & | assign (const char(&str)[N]) noexcept |
| assigns a char array to string with compile time check if the array size is less than or equal to the string capacity More...
|
|
bool | unsafe_assign (const char *const str) noexcept |
| assigns a cstring to string. The assignment fails if the cstring size is greater than the string capacity. More...
|
|
bool | unsafe_assign (const std::string &str) noexcept |
| assigns a std::string to string. The assignment fails if the std::string size is greater than the string capacity. More...
|
|
template<uint64_t N> |
int64_t | compare (const string< N > &other) const noexcept |
| compares two strings More...
|
|
template<uint64_t N> |
bool | operator== (const string< N > &rhs) const noexcept |
| checks if self is equal to rhs More...
|
|
template<uint64_t N> |
bool | operator!= (const string< N > &rhs) const noexcept |
| checks if self is not equal to rhs More...
|
|
template<uint64_t N> |
bool | operator< (const string< N > &rhs) const noexcept |
| checks if self is less than rhs, in lexicographical order More...
|
|
template<uint64_t N> |
bool | operator<= (const string< N > &rhs) const noexcept |
| checks if self is less than or equal to rhs, in lexicographical order More...
|
|
template<uint64_t N> |
bool | operator> (const string< N > &rhs) const noexcept |
| checks if self is greater than rhs, in lexicographical order More...
|
|
template<uint64_t N> |
bool | operator>= (const string< N > &rhs) const noexcept |
| checks if self is greater than or equal to rhs, in lexicographical order More...
|
|
bool | operator== (const char *const rhs) const noexcept |
| The equality operator for fixed string and char pointer is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char* const other, const uint64_t count) before compare it to a fixed string. More...
|
|
bool | operator!= (const char *const rhs) const noexcept |
| The inequality operator for fixed string and char pointer is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char* const other, const uint64_t count) before compare it to a fixed string. More...
|
|
const char * | c_str () const noexcept |
| returns a pointer to the char array of self More...
|
|
constexpr uint64_t | size () const noexcept |
| returns the number of characters stored in the string More...
|
|
constexpr uint64_t | capacity () const noexcept |
| returns the maximum number of characters that can be stored in the string More...
|
|
constexpr bool | empty () const noexcept |
| returns if the string is empty or not More...
|
|
| operator std::string () const noexcept |
| converts the string to a std::string More...
|
|
template<typename T > |
string & | operator+= (const T &) noexcept |
| since there are two valid options for what should happen when appending a string larger than this' capacity (failing or truncating), the fixed string does not support operator+=; use append for truncating or unsafe_append for failing in that case
|
|
template<typename T > |
std::enable_if< internal::IsCharArray< T >::value||internal::IsCxxString< T >::value, string & >::type | append (TruncateToCapacity_t, const T &t) noexcept |
| appends a fixed string or string literal to the end of this. If this' capacity is too small for appending the whole string (literal) the remainder of the characters are truncated. More...
|
|
template<typename T > |
std::enable_if< internal::IsCharArray< T >::value||internal::IsCxxString< T >::value, bool >::type | unsafe_append (const T &t) noexcept |
| appends a fixed string or string literal to the end of this. The appending fails if the sum of both sizes is greater than this' capacity. More...
|
|
iox::cxx::optional< string< Capacity > > | substr (const uint64_t pos, const uint64_t count) const noexcept |
| creates a substring containing the characters from pos until count; if pos+count is greater than the size of the original string the returned substring only contains the characters from pos until size(); iox::cxx::nullopt is returned if pos is greater than the size of the original string; More...
|
|
iox::cxx::optional< string< Capacity > > | substr (const uint64_t pos=0U) const noexcept |
| creates a substring containing the characters from pos until size(); iox::cxx::nullopt is returned if pos is greater than the size of the original string More...
|
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value||internal::IsCharArray< T >::value||internal::IsCxxString< T >::value, iox::cxx::optional< uint64_t > >::type | find (const T &t, const uint64_t pos=0U) const noexcept |
| finds the first occurence of the given character sequence; returns the position of the first character of the found substring, returns iox::cxx::nullopt if no substring is found or if pos is greater than this' size More...
|
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value||internal::IsCharArray< T >::value||internal::IsCxxString< T >::value, iox::cxx::optional< uint64_t > >::type | find_first_of (const T &t, const uint64_t pos=0U) const noexcept |
| finds the first occurence of a character equal to one of the characters of the given character sequence and returns its position; returns iox::cxx::nullopt if no character is found or if pos is greater than this' size More...
|
|
template<typename T > |
std::enable_if< std::is_same< T, std::string >::value||internal::IsCharArray< T >::value||internal::IsCxxString< T >::value, iox::cxx::optional< uint64_t > >::type | find_last_of (const T &t, const uint64_t pos=Capacity) const noexcept |
| finds the last occurence of a character equal to one of the characters of the given character sequence and returns its position; returns iox::cxx::nullopt if no character is found More...
|
|
template<uint64_t N> |
string< Capacity > & | operator= (const string< N > &rhs) noexcept |
|
template<uint64_t N> |
string< Capacity > & | operator= (string< N > &&rhs) noexcept |
|
template<uint64_t N> |
string< Capacity > & | operator= (const char(&rhs)[N]) noexcept |
|
template<uint64_t N> |
string< Capacity > & | assign (const string< N > &str) noexcept |
|
template<uint64_t N> |
string< Capacity > & | assign (const char(&str)[N]) noexcept |
|
template<uint64_t N> |
string< Capacity > & | copy (const string< N > &rhs) noexcept |
|
template<uint64_t N> |
string< Capacity > & | move (string< N > &&rhs) noexcept |
|
template<typename T > |
string< Capacity > & | operator+= (const T &) noexcept |
|
template<uint64_t Capacity>
class iox::cxx::string< Capacity >
string implementation with some adjustments in the API, because we are not allowed to throw exceptions or use heap. Please see iceoryx/iceoryx_utils/doc/fixedString.adoc for further information.