|
iceoryx2
C++ Language Bindings
|
The SemanticString is a string which has an inner syntax and restrictions to valid content. Examples are for instance. More...
#include <semantic_string.hpp>
Public Member Functions | |
| constexpr auto | size () const noexcept -> uint64_t |
| Returns the number of characters. | |
| constexpr auto | as_string () const noexcept -> const bb::StaticString< Capacity > & |
| Returns a const reference to the underlying string. It is const and shall not be modified to guarantee the contract that a SemanticString contains always a valid value. | |
| template<typename T > | |
| auto | append (const T &value) noexcept -> bb::Expected< void, SemanticStringError > |
| Appends another string to the SemanticString. If the value contains invalid characters or the result would end up in invalid content it fails. | |
| template<typename T > | |
| auto | insert (uint64_t pos, const T &str, uint64_t count) noexcept -> bb::Expected< void, SemanticStringError > |
| Inserts another string into the SemanticString. If the value contains invalid characters or the result would end up in invalid content it fails. | |
| auto | operator== (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is equal to this string | |
| template<typename T > | |
| auto | operator== (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is equal to this string | |
| auto | operator!= (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is not equal to this string | |
| template<typename T > | |
| auto | operator!= (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is not equal to this string | |
| auto | operator<= (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is less than or equal this string | |
| template<typename T > | |
| auto | operator<= (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is less than or equal this string | |
| auto | operator< (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is less than this string | |
| template<typename T > | |
| auto | operator< (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is less than this string | |
| auto | operator>= (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is greater than or equal this string | |
| template<typename T > | |
| auto | operator>= (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is greater than or equal this string | |
| auto | operator> (const SemanticString &rhs) const noexcept -> bool |
| checks if another SemanticString is greater than this string | |
| template<typename T > | |
| auto | operator> (const T &rhs) const noexcept -> bb::RequireStaticStringOrCharArray< T, bool > |
| checks if another string or char array is greater than this string | |
Static Public Member Functions | |
| template<uint64_t N> | |
| static auto | create (const char(&value)[N]) noexcept -> bb::Expected< Child, SemanticStringError > |
| Creates a new SemanticString from the provided string literal. If the value contains invalid characters or invalid content the expected returns an error describing the cause. | |
| template<uint64_t N> | |
| static auto | create (const bb::StaticString< N > &value) noexcept -> bb::Expected< Child, SemanticStringError > |
| Creates a new SemanticString from the provided string. If the value contains invalid characters or invalid content the expected returns an error describing the cause. | |
| static constexpr auto | capacity () noexcept -> uint64_t |
| Returns the capacity of the string. | |
Protected Member Functions | |
| template<uint64_t N> | |
| SemanticString (const bb::StaticString< N > &value) noexcept | |
The SemanticString is a string which has an inner syntax and restrictions to valid content. Examples are for instance.
Definition at line 65 of file semantic_string.hpp.
|
inlineexplicitprotectednoexcept |
Definition at line 202 of file semantic_string.hpp.
|
inlinenoexcept |
Appends another string to the SemanticString. If the value contains invalid characters or the result would end up in invalid content it fails.
| [in] | value | the value which should be added |
Definition at line 299 of file semantic_string.hpp.
References iox2::bb::detail::get_size(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::insert(), and iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::size().
|
constexprnoexcept |
Returns a const reference to the underlying string. It is const and shall not be modified to guarantee the contract that a SemanticString contains always a valid value.
Definition at line 289 of file semantic_string.hpp.
Referenced by iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator!=(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator!=(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator<(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator<(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator<=(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator<=(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator==(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator==(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator>(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator>(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator>=(), and iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::operator>=().
|
staticconstexprnoexcept |
Returns the capacity of the string.
Definition at line 279 of file semantic_string.hpp.
|
inlinestaticnoexcept |
Creates a new SemanticString from the provided string. If the value contains invalid characters or invalid content the expected returns an error describing the cause.
| [in] | value | the value of the SemanticString |
Definition at line 258 of file semantic_string.hpp.
|
inlinestaticnoexcept |
Creates a new SemanticString from the provided string literal. If the value contains invalid characters or invalid content the expected returns an error describing the cause.
| [in] | value | the value of the SemanticString |
Definition at line 245 of file semantic_string.hpp.
|
inlinenoexcept |
Inserts another string into the SemanticString. If the value contains invalid characters or the result would end up in invalid content it fails.
| [in] | pos | the position where the string should be inserted |
| [in] | str | the value which should be added |
| [in] | count | how many characters of str shall be inserted |
Definition at line 309 of file semantic_string.hpp.
References iox2::Debug, iox2::bb::err(), iox2::bb::ExceedsMaximumLength, iox2::bb::InvalidContent, and IOX2_LOG.
Referenced by iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::append().
|
inlinenoexcept |
checks if another SemanticString is not equal to this string
| [in] | rhs | the other SemanticString |
Definition at line 364 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is not equal to this string
| [in] | rhs | the other string |
Definition at line 374 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another SemanticString is less than this string
| [in] | rhs | the other SemanticString |
Definition at line 402 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is less than this string
| [in] | rhs | the other string |
Definition at line 412 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another SemanticString is less than or equal this string
| [in] | rhs | the other SemanticString |
Definition at line 383 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is less than or equal this string
| [in] | rhs | the other string |
Definition at line 393 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another SemanticString is equal to this string
| [in] | rhs | the other SemanticString |
Definition at line 345 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is equal to this string
| [in] | rhs | the other string |
Definition at line 355 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another SemanticString is greater than this string
| [in] | rhs | the other SemanticString |
Definition at line 440 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is greater than this string
| [in] | rhs | the other string |
Definition at line 450 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another SemanticString is greater than or equal this string
| [in] | rhs | the other SemanticString |
Definition at line 421 of file semantic_string.hpp.
|
inlinenoexcept |
checks if another string or char array is greater than or equal this string
| [in] | rhs | the other string |
Definition at line 431 of file semantic_string.hpp.
|
constexprnoexcept |
Returns the number of characters.
Definition at line 269 of file semantic_string.hpp.
References iox2::bb::StaticString< N >::size().
Referenced by iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::append().