|
iceoryx2
C++ Language Bindings
|
#include <static_string.hpp>
Classes | |
| class | ConstAccessorCodeUnits |
| This class provides the interface for accessing individual code units of the string. More... | |
| class | UncheckedAccessor |
| class | UncheckedAccessorCodeUnits |
| class | UncheckedConstAccessor |
Public Types | |
| using | ValueType = char |
| using | CodeUnitValueType = char |
| using | CodePointValueType = char32_t |
| using | SizeType = size_t |
| using | DifferenceType = ptrdiff_t |
| using | Reference = char & |
| using | ConstReference = char const & |
| using | Pointer = char * |
| using | ConstPointer = char const * |
| using | Iterator = Pointer |
| using | ConstIterator = ConstPointer |
| using | OptionalReference = bb::Optional< std::reference_wrapper< char > > |
| using | OptionalConstReference = bb::Optional< std::reference_wrapper< char const > > |
| using | OptionalCodeUnitReference = bb::Optional< std::reference_wrapper< CodeUnitValueType > > |
| using | OptionalConstCodeUnitReference = bb::Optional< std::reference_wrapper< CodeUnitValueType const > > |
Public Member Functions | |
| constexpr | StaticString () noexcept=default |
| constexpr | StaticString (StaticString const &) noexcept=default |
| constexpr | StaticString (StaticString &&) noexcept=default |
| template<uint64_t M, std::enable_if_t<(N > M), bool > = true> | |
| constexpr | StaticString (StaticString< M > const &rhs) |
| IOX2_CONSTEXPR_DTOR | ~StaticString ()=default |
| constexpr auto | operator= (StaticString const &) noexcept -> StaticString &=default |
| constexpr auto | operator= (StaticString &&) noexcept -> StaticString &=default |
| template<uint64_t M, std::enable_if_t<(N > M), bool > = true> | |
| constexpr auto | operator= (StaticString< M > const &rhs) noexcept -> StaticString & |
| constexpr auto | try_push_back (CodeUnitValueType character) noexcept -> bool |
| constexpr auto | try_pop_back () noexcept -> bool |
| constexpr auto | try_append (SizeType count, CodeUnitValueType character) noexcept -> bool |
| constexpr auto | try_append_utf8_null_terminated_unchecked (char const *utf8_str) -> bool |
| constexpr auto | size () const noexcept -> SizeType |
| constexpr auto | empty () const -> bool |
| auto | unchecked_code_units () -> UncheckedAccessorCodeUnits |
| Unchecked mutable access to the string contents on a per-code-unit basis. | |
| auto | code_units () const -> ConstAccessorCodeUnits |
| Immutable access to the string contents on a per-code-unit basis. | |
| auto | unchecked_access () -> UncheckedAccessor |
| Unchecked mutable access to the string contents. | |
| auto | unchecked_access () const -> UncheckedConstAccessor |
| Unchecked immutable access to the string contents. | |
| constexpr auto | static_memory_layout_metrics () noexcept |
Static Public Member Functions | |
| template<uint64_t M, std::enable_if_t<(N >=(M - 1)), bool > = true> | |
| static auto | from_utf8 (char const (&utf8_str)[M]) noexcept -> bb::Optional< StaticString > |
| static auto | from_utf8_null_terminated_unchecked (char const *utf8_str) -> bb::Optional< StaticString > |
| template<uint64_t M, std::enable_if_t<(N >=(M - 1)), bool > = true> | |
| static auto | from_utf8_unchecked (char const (&utf8_str)[M]) noexcept -> StaticString |
| static auto | from_utf8_null_terminated_unchecked_truncated (char const *utf8_str, SizeType count) -> StaticString |
| static constexpr auto | capacity () noexcept -> SizeType |
Friends | |
| template<uint64_t > | |
| class | StaticString |
| auto | operator== (StaticString const &lhs, StaticString const &rhs) -> bool |
| auto | operator!= (StaticString const &lhs, StaticString const &rhs) -> bool |
| auto | operator< (StaticString const &lhs, StaticString const &rhs) -> bool |
| auto | operator<= (StaticString const &lhs, StaticString const &rhs) -> bool |
| auto | operator> (StaticString const &lhs, StaticString const &rhs) -> bool |
| auto | operator>= (StaticString const &lhs, StaticString const &rhs) -> bool |
A UTF-8 string with fixed static capacity and contiguous inplace storage. The string class uses Unicode (ISO/IEC 10646) terminology throughout its interface. In particular:
| N | Maximum number of UTF-8 code units that the string can store, excluding the terminating NUL character. |
Definition at line 81 of file static_string.hpp.
| using iox2::bb::StaticString< N >::CodePointValueType = char32_t |
Definition at line 85 of file static_string.hpp.
| using iox2::bb::StaticString< N >::CodeUnitValueType = char |
Definition at line 84 of file static_string.hpp.
| using iox2::bb::StaticString< N >::ConstIterator = ConstPointer |
Definition at line 93 of file static_string.hpp.
| using iox2::bb::StaticString< N >::ConstPointer = char const* |
Definition at line 91 of file static_string.hpp.
| using iox2::bb::StaticString< N >::ConstReference = char const& |
Definition at line 89 of file static_string.hpp.
| using iox2::bb::StaticString< N >::DifferenceType = ptrdiff_t |
Definition at line 87 of file static_string.hpp.
| using iox2::bb::StaticString< N >::Iterator = Pointer |
Definition at line 92 of file static_string.hpp.
| using iox2::bb::StaticString< N >::OptionalCodeUnitReference = bb::Optional<std::reference_wrapper<CodeUnitValueType> > |
Definition at line 96 of file static_string.hpp.
| using iox2::bb::StaticString< N >::OptionalConstCodeUnitReference = bb::Optional<std::reference_wrapper<CodeUnitValueType const> > |
Definition at line 97 of file static_string.hpp.
| using iox2::bb::StaticString< N >::OptionalConstReference = bb::Optional<std::reference_wrapper<char const> > |
Definition at line 95 of file static_string.hpp.
| using iox2::bb::StaticString< N >::OptionalReference = bb::Optional<std::reference_wrapper<char> > |
Definition at line 94 of file static_string.hpp.
| using iox2::bb::StaticString< N >::Pointer = char* |
Definition at line 90 of file static_string.hpp.
| using iox2::bb::StaticString< N >::Reference = char& |
Definition at line 88 of file static_string.hpp.
| using iox2::bb::StaticString< N >::SizeType = size_t |
Definition at line 86 of file static_string.hpp.
| using iox2::bb::StaticString< N >::ValueType = char |
Definition at line 83 of file static_string.hpp.
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
inlineconstexpr |
Definition at line 422 of file static_string.hpp.
|
default |
|
inlinestaticconstexprnoexcept |
Definition at line 584 of file static_string.hpp.
|
inline |
Immutable access to the string contents on a per-code-unit basis.
Definition at line 602 of file static_string.hpp.
|
inlineconstexpr |
Definition at line 592 of file static_string.hpp.
References iox2::bb::StaticString< N >::size().
Referenced by iox2::bb::StaticString< N >::ConstAccessorCodeUnits::back_element(), iox2::bb::StaticString< N >::UncheckedAccessorCodeUnits::back_element(), iox2::bb::StaticString< N >::ConstAccessorCodeUnits::front_element(), and iox2::bb::StaticString< N >::UncheckedAccessorCodeUnits::front_element().
|
inlinestaticnoexcept |
Constructs a StaticString from a C-string literal.
Definition at line 453 of file static_string.hpp.
References iox2::bb::NULLOPT, and iox2::bb::StaticString< N >::try_push_back().
|
inlinestatic |
Constructs a StaticString from a null terminated C-style string. This unchecked function allows for uncontrolled memory access. Users of this must ensure that the input string is properly null terminated.
Definition at line 472 of file static_string.hpp.
References iox2::bb::NULLOPT, and iox2::bb::StaticString< N >::try_push_back().
Referenced by iox2::internal::get_type_name_impl().
|
inlinestatic |
Constructs a StaticString from up to count characters of a C-style string. If the capacity of the StaticString would be exceeded, the input string is truncated. This unchecked function allows for uncontrolled memory access. User of this must ensure that the input string is null-terminated if count exceeds the string length and the truncated string represents a valid UTF-8 encoding.
Definition at line 505 of file static_string.hpp.
|
inlinestaticnoexcept |
Constructs a StaticString from a C-string literal. Users must ensure that the input string represents a valid UTF-8 encoding.
Definition at line 488 of file static_string.hpp.
Referenced by iox2::bb::detail::is_valid_path_entry(), and iox2::bb::detail::is_valid_path_to_directory().
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Definition at line 437 of file static_string.hpp.
|
inlineconstexprnoexcept |
Definition at line 588 of file static_string.hpp.
Referenced by iox2::bb::StaticString< N >::ConstAccessorCodeUnits::back_element(), iox2::bb::StaticString< N >::UncheckedAccessorCodeUnits::back_element(), iox2::bb::StaticString< N >::empty(), iox2::bb::SemanticString< Child, Capacity, DoesContainInvalidContentCall, DoesContainInvalidCharacterCall >::size(), and iox2::bb::StaticString< N >::try_append_utf8_null_terminated_unchecked().
|
inlineconstexprnoexcept |
Obtains metrics about the internal memory layout of the vector. This function is intended for internal use only.
Definition at line 646 of file static_string.hpp.
|
inlineconstexprnoexcept |
Attempt to append count instances of character to the back of the string.
Definition at line 552 of file static_string.hpp.
|
inlineconstexpr |
Appends a null terminated C-style string. This unchecked function allows for uncontrolled memory access. Users of this must ensure that the input string is properly null terminated.
Definition at line 570 of file static_string.hpp.
References iox2::bb::StaticString< N >::size(), and iox2::bb::StaticString< N >::try_push_back().
|
inlineconstexprnoexcept |
Attempt to pop a single code unit from the back of the string.
Definition at line 538 of file static_string.hpp.
|
inlineconstexprnoexcept |
Attempt to append a single code unit to the back of the string.
Definition at line 521 of file static_string.hpp.
Referenced by iox2::bb::StaticString< N >::from_utf8(), iox2::bb::StaticString< N >::from_utf8_null_terminated_unchecked(), and iox2::bb::StaticString< N >::try_append_utf8_null_terminated_unchecked().
|
inline |
Unchecked mutable access to the string contents.
Definition at line 607 of file static_string.hpp.
|
inline |
Unchecked immutable access to the string contents.
Definition at line 612 of file static_string.hpp.
|
inline |
Unchecked mutable access to the string contents on a per-code-unit basis.
Definition at line 597 of file static_string.hpp.
|
friend |
Definition at line 624 of file static_string.hpp.
|
friend |
Definition at line 628 of file static_string.hpp.
|
friend |
Definition at line 632 of file static_string.hpp.
|
friend |
Definition at line 617 of file static_string.hpp.
|
friend |
Definition at line 636 of file static_string.hpp.
|
friend |
Definition at line 640 of file static_string.hpp.
Definition at line 408 of file static_string.hpp.