Template Class String

Inheritance Relationships

Base Type

Class Documentation

template<::size64_t STRING_BUFFER_SIZE>
class String : public apex::BaseString<STRING_BUFFER_SIZE>

String defines a string class with constant memory footprint. Objects of this class do not throw exceptions if the dst string does not have enough space. In this case the dst is filled up to capacity from src. The internal buffer size is defined by STRING_BUFFER_SIZE template parameter. The maximum length for a string is (STRING_BUFFER_SIZE - 1ULL). One character is reserved for terminating zero.

Template Parameters:

STRING_BUFFER_SIZE – defines the size of static string including its terminating zero.

Public Types

iterator = typename apex::template BaseString< STRING_BUFFER_SIZE >::template abs_iterator<::char8_t >
const_iterator = typename apex::template BaseString< STRING_BUFFER_SIZE >::template abs_iterator< const ::char8_t >

Public Functions

inline String(void) noexcept

default constructor

inline  String (const ::size64_t n, const ::char8_t c) noexcept

fill constructor Fills the string with n consecutive copies of character c. param[in] n is number of characters to copy. If n is grater than the maximum capacity or if npos, only maximum capacity is filled param[in] c is number of characters to copy.

inline String &operator+=(const char8_t *const src) noexcept

operator+=

inline String &operator+=(const char8_t chr) noexcept

operator += chr

inline  String (const ::char8_t *const str) noexcept

constructor from an input string

inline explicit String(const ::apex_string_t &str) noexcept

constructor from an Apex.OS string

template<::size64_t LEN>
inline String(const apex::BaseString<LEN> &src) noexcept

copy constructor

inline explicit String(const apex::String<STRING_BUFFER_SIZE> &src) noexcept

copy constructor See MISRA C++:2008 14-5-2

template<::size64_t LEN>
inline const apex::String<STRING_BUFFER_SIZE + LEN> operator+(const apex::String<LEN> &rhs) const noexcept

operator+

template<::size64_t LEN>
inline auto operator+(const char (&rhs)[LEN]) const noexcept

operator+

inline const apex::String<STRING_BUFFER_SIZE + APEX_STRING_SIZE> operator+(const ::apex_string_t &rhs) const noexcept

operator+

template<::size64_t LEN>
inline apex::String<STRING_BUFFER_SIZE> &operator+=(const apex::String<LEN> &rhs) noexcept

operator+=

inline apex::String<STRING_BUFFER_SIZE> &operator+=(const ::apex_string_t &src) noexcept

operator+=

inline String &operator=(const String &rhs) noexcept

Assignment operator. See MISRA C++:2008 14-5-3.

template<::size64_t LEN>
inline apex::String<STRING_BUFFER_SIZE> &operator=(const apex::String<LEN> &rhs) noexcept

Assignment operator.

inline apex::String< STRING_BUFFER_SIZE > & operator= (const ::char8_t *const src) noexcept

Assignment operator.

inline apex::String<STRING_BUFFER_SIZE> &operator=(const ::apex_string_t &src) noexcept

Assignment operator.

inline iterator begin() noexcept

Retrieves the begin iterator for this string.

Returns:

the begin iterator

inline iterator end() noexcept

Retrieves the end iterator for this string.

Returns:

the end iterator

inline const_iterator cbegin() const noexcept

Retrieves the begin constant iterator for this string.

Returns:

the begin iterator

inline const_iterator cend() const noexcept

Retrieves the end constant iterator for this string.

Returns:

the end iterator

Public Static Functions

static inline apex::String<STRING_BUFFER_SIZE> to_string(const uint32_t value)

Convert 32-bit unsigned integer in base 10 into an Apex.OS string. The method will throw std::overflow_error exception if the string’s capacity is insufficient.

Parameters:

value[in] is input 32-bit unsigned integer value to convert

Throws:

std::overflow_error

Returns:

return Apex.OS string that contains text representation of the input value in base 10.