Loading...
Searching...
No Matches
etl::u16string< MAX_SIZE_ > Class Template Reference

`#include <u16string.h>`

## Public Types

typedef iu16string | base_type
typedef iu16string | interface_type
typedef iu16string::value_type | value_type
Public Types inherited from etl::ibasic_string< char16_t >
typedef ibasic_string< char16_t > | interface_type
typedef char16_t | value_type
typedef char16_t & | reference
typedef const char16_t & | const_reference
typedef char16_t * | pointer
typedef const char16_t * | const_pointer
typedef char16_t * | iterator
typedef const char16_t * | const_iterator
typedef ETL_OR_STD::reverse_iterator< iterator > | reverse_iterator
typedef ETL_OR_STD::reverse_iterator< const_iterator > | const_reverse_iterator
typedef etl::iterator_traits< iterator >::difference_type | difference_type
Public Types inherited from etl::string_base
typedef size_t | size_type
Public Types inherited from etl::private_basic_string::string_base_statics< T >
typedef size_t | size_type

## Public Member Functions

| u16string ()
| Constructor.
| u16string (const etl::u16string< MAX_SIZE_ > &other)
| u16string (const etl::iu16string &other)
| u16string (const etl::iu16string &other, size_type position, size_type length=npos)
ETL_EXPLICIT_STRING_FROM_CHAR | u16string (const value_type *text)
| u16string (const value_type *text, size_type count)
| u16string (size_type count, value_type c)
template<typename TIterator>
| u16string (TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
| u16string (const etl::u16string_view &view)
etl::u16string< MAX_SIZE_ > | substr (size_type position=0, size_type length_=npos) const
u16string & | operator= (const u16string &rhs)
| Assignment operator.
u16string & | operator= (const value_type *text)
| Assignment operator.
u16string & | operator= (const etl::u16string_view &view)
| Assignment operator.
void | repair ()
| Fix the internal pointers after a low level memory copy.
Public Member Functions inherited from etl::ibasic_string< char16_t >
iterator | begin ()
const_iterator | begin () const
iterator | end ()
const_iterator | end () const
const_iterator | cbegin () const
const_iterator | cend () const
reverse_iterator | rbegin ()
const_reverse_iterator | rbegin () const
reverse_iterator | rend ()
const_reverse_iterator | rend () const
const_reverse_iterator | crbegin () const
const_reverse_iterator | crend () const
void | resize (size_type new_size)
void | resize (size_type new_size, char16_t value)
void | resize_and_overwrite (size_type new_size, TOperation operation)
| Resizes the string and overwrites to data using the operation.
void | uninitialized_resize (size_type new_size)
void | fill (char16_t value)
reference | operator[] (size_type i)
const_reference | operator[] (size_type i) const
reference | at (size_type i)
const_reference | at (size_type i) const
reference | front ()
const_reference | front () const
reference | back ()
const_reference | back () const
pointer | data ()
ETL_CONSTEXPR const_pointer | data () const
pointer | data_end ()
const_pointer | data_end () const
void | assign (const etl::ibasic_string< char16_t > &other)
void | assign (const etl::ibasic_string< char16_t > &other, size_type subposition, size_type sublength)
void | assign (TIterator first, TIterator last)
void | assign (const_pointer str)
void | assign (const_pointer str, size_type n)
void | assign (const etl::basic_string_view< char16_t, TOtherTraits > &view)
| Assigns values to the string from a view.
void | assign (size_type n, char16_t c)
void | clear ()
| Clears the string.
void | push_back (char16_t value)
void | pop_back ()
ibasic_string & | append (const ibasic_string &str)
ibasic_string & | append (const ibasic_string &str, size_type subposition, size_type sublength=npos)
ibasic_string & | append (TIterator first, TIterator last)
ibasic_string & | append (const_pointer str)
ibasic_string & | append (const_pointer str, size_type n)
ibasic_string & | append (const etl::basic_string_view< char16_t, TOtherTraits > &view)
ibasic_string & | append (size_type n, char16_t c)
iterator | insert (const_iterator position, char16_t value)
iterator | insert (const_iterator position, size_type n, char16_t value)
iterator | insert (const_iterator position, TIterator first, TIterator last)
iterator | insert (const_iterator position, const etl::basic_string_view< char16_t, TOtherTraits > &view)
etl::ibasic_string< char16_t > & | insert (size_type position, const etl::ibasic_string< char16_t > &str)
etl::ibasic_string< char16_t > & | insert (size_type position, const etl::basic_string_view< char16_t, TOtherTraits > &view)
etl::ibasic_string< char16_t > & | insert (size_type position, const etl::ibasic_string< char16_t > &str, size_type subposition, size_type sublength)
etl::ibasic_string< char16_t > & | insert (size_type position, const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type subposition, size_type sublength)
etl::ibasic_string< char16_t > & | insert (size_type position, const_pointer s)
etl::ibasic_string< char16_t > & | insert (size_type position, const_pointer s, size_type n)
etl::ibasic_string< char16_t > & | insert (size_type position, size_type n, value_type c)
etl::ibasic_string< char16_t > & | erase (size_type position, size_type length_=npos)
iterator | erase (iterator i_element)
iterator | erase (const_iterator i_element)
iterator | erase (const_iterator first, const_iterator last)
const_pointer | c_str () const
| Return a pointer to a C string.
size_type | copy (pointer dest, size_type count, size_type pos=0) const
size_type | find (const ibasic_string< char16_t > &str, size_type pos=0) const
size_type | find (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type pos=0) const
size_type | find (const_pointer s, size_type pos=0) const
size_type | find (const_pointer s, size_type pos, size_type n) const
size_type | find (char16_t c, size_type position=0) const
size_type | rfind (const ibasic_string< char16_t > &str, size_type position=npos) const
size_type | rfind (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type pos=0) const
size_type | rfind (const_pointer s, size_type position=npos) const
size_type | rfind (const_pointer s, size_type position, size_type length_) const
size_type | rfind (char16_t c, size_type position=npos) const
bool | contains (const etl::ibasic_string< char16_t > &str) const
| Checks that the string is within this string.
bool | contains (const etl::basic_string_view< char16_t, TOtherTraits > &view) const
| Checks that the view is within this string.
bool | contains (const_pointer s) const
| Checks that text is within this string.
bool | contains (value_type c) const
| Checks that character is within this string.
bool | starts_with (const etl::ibasic_string< char16_t > &str) const
| Checks that the string is the start of this string.
bool | starts_with (const etl::basic_string_view< char16_t, TOtherTraits > &view) const
| Checks that the view is the start of this string.
bool | starts_with (const_pointer s) const
| Checks that the string is the start of this string.
bool | starts_with (value_type c) const
| Checks that the character is the start of this string.
bool | ends_with (const etl::ibasic_string< char16_t > &str) const
| Checks that the string is the end of this string.
bool | ends_with (const etl::basic_string_view< char16_t, TOtherTraits > &view) const
| Checks that the view is the end of this string.
bool | ends_with (const_pointer s) const
| Checks that the string is the end of this string.
bool | ends_with (value_type c) const
| Checks that the character is the end of this string.
ibasic_string & | replace (size_type position, size_type length_, const ibasic_string &str)
ibasic_string & | replace (size_type position, size_type length_, const etl::basic_string_view< char16_t, TOtherTraits > &view)
ibasic_string & | replace (const_iterator first, const_iterator last, const ibasic_string &str)
ibasic_string & | replace (const_iterator first, const_iterator last, const etl::basic_string_view< char16_t, TOtherTraits > &view)
ibasic_string & | replace (size_type position, size_type length_, const ibasic_string &str, size_type subposition, size_type sublength)
ibasic_string & | replace (size_type position, size_type length_, const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type subposition, size_type sublength)
ibasic_string & | replace (size_type position, size_type length_, const_pointer s)
| Replace characters from 'position' of 'length' with pointed to string.
ibasic_string & | replace (const_iterator first, const_iterator last, const_pointer s, size_type n)
etl::enable_if< etl::is_same< TIterator, const_pointer >::value, ibasic_string >::type & | replace (const_iterator first, const_iterator last, TIterator s)
| Replace characters from 'first' to 'last' with pointed to string.
ibasic_string & | replace (const_iterator first, const_iterator last, const value_type(&literal)[Size])
| Replace characters from 'first' 'last' with pointed to literal string.
ibasic_string & | replace (size_type position, size_type length_, const_pointer s, size_type n)
ibasic_string & | replace (size_type position, size_type length_, size_type n, value_type c)
| Replace characters from 'position' of 'length' with 'n' copies of 'c'.
ibasic_string & | replace (const_iterator first, const_iterator last, size_type n, value_type c)
| Replace characters from 'first' of 'last' with 'n' copies of 'c'.
ibasic_string & | replace (const_iterator first, const_iterator last, TIterator first_replace, TIterator last_replace)
int | compare (const ibasic_string &str) const
| Compare with string.
int | compare (const etl::basic_string_view< char16_t, TOtherTraits > &view) const
| Compare with etl::basic_string_view.
int | compare (size_type position, size_type length_, const ibasic_string &str) const
| Compare position / length with string.
int | compare (size_type position, size_type length_, const etl::basic_string_view< char16_t, TOtherTraits > &view) const
| Compare position / length with etl::basic_string_view.
int | compare (size_type position, size_type length_, const ibasic_string &str, size_type subposition, size_type sublength) const
| Compare position / length with string / subposition / sublength.
int | compare (size_type position, size_type length_, const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type subposition, size_type sublength) const
int | compare (const value_type *s) const
| Compare with C string.
int | compare (size_type position, size_type length_, const_pointer s) const
| Compare position / length with C string.
int | compare (size_type position, size_type length_, const_pointer s, size_type n) const
| Compare position / length with C string / n.
size_type | find_first_of (const ibasic_string< char16_t > &str, size_type position=0) const
size_type | find_first_of (const_pointer s, size_type position=0) const
size_type | find_first_of (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type position=0) const
size_type | find_first_of (const_pointer s, size_type position, size_type n) const
size_type | find_first_of (value_type c, size_type position=0) const
size_type | find_last_of (const ibasic_string< char16_t > &str, size_type position=npos) const
size_type | find_last_of (const_pointer s, size_type position=npos) const
size_type | find_last_of (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type position=npos) const
size_type | find_last_of (const_pointer s, size_type position, size_type n) const
size_type | find_last_of (value_type c, size_type position=npos) const
size_type | find_first_not_of (const ibasic_string< char16_t > &str, size_type position=0) const
size_type | find_first_not_of (const_pointer s, size_type position=0) const
size_type | find_first_not_of (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type position=0) const
size_type | find_first_not_of (const_pointer s, size_type position, size_type n) const
size_type | find_first_not_of (value_type c, size_type position=0) const
size_type | find_last_not_of (const ibasic_string< char16_t > &str, size_type position=npos) const
size_type | find_last_not_of (const_pointer s, size_type position=npos) const
size_type | find_last_not_of (const etl::basic_string_view< char16_t, TOtherTraits > &view, size_type position=npos) const
size_type | find_last_not_of (const_pointer s, size_type position, size_type n) const
size_type | find_last_not_of (value_type c, size_type position=npos) const
ibasic_string & | operator= (const ibasic_string &rhs)
| Assignment operator.
ibasic_string & | operator= (const_pointer rhs)
| Assignment operator.
ibasic_string & | operator= (const etl::basic_string_view< char16_t, TOtherTraits > &view)
| Assignment operator.
ibasic_string & | operator+= (const ibasic_string &rhs)
| += operator.
ibasic_string & | operator+= (const etl::basic_string_view< char16_t, TOtherTraits > &rhs)
| += operator.
ibasic_string & | operator+= (const_pointer rhs)
| += operator.
ibasic_string & | operator+= (char16_t rhs)
| += operator.
void | initialize_free_space ()
| Clears the free space to string terminator value.
void | trim_to_terminator ()
Public Member Functions inherited from etl::string_base
size_type | size () const
size_type | length () const
bool | empty () const
bool | full () const
size_type | capacity () const
size_type | max_size () const
size_type | available () const
bool | is_truncated () const
ETL_DEPRECATED bool | truncated () const
void | clear_truncated ()
| Clears the 'truncated' flag.
void | set_secure ()
| Sets the 'secure' flag to the requested state.
bool | is_secure () const
| Gets the 'secure' state flag.

## Static Public Attributes

static const size_t | MAX_SIZE = MAX_SIZE_
Static Public Attributes inherited from etl::private_basic_string::string_base_statics< T >
static ETL_CONSTANT uint_least8_t | IS_TRUNCATED = etl::bit<0>::value
static ETL_CONSTANT uint_least8_t | CLEAR_AFTER_USE = etl::bit<1>::value
static ETL_CONSTANT size_type | npos = etl::integral_limits<size_type>::max

## Additional Inherited Members

Protected Member Functions inherited from etl::ibasic_string< char16_t >
| ibasic_string (char16_t *p_buffer_, size_type MAX_SIZE_)
| Constructor.
void | initialise ()
| Initialise the string.
void | repair_buffer (char16_t *p_buffer_)
| Fix the internal pointers after a low level memory copy.
| ~ibasic_string ()
| Destructor.
iterator | to_iterator (const_iterator itr) const
| Convert from const_iterator to iterator.
bool | is_within_buffer (const_pointer ptr) const
| Checks if a pointer is within the buffer.
Protected Member Functions inherited from etl::string_base
| string_base (size_type max_size_)
| Constructor.
void | set_truncated (bool status)
| Sets the 'truncated' flag.
| ~string_base ()
| Destructor.
Protected Attributes inherited from etl::string_base
size_type | current_size
| The current number of elements in the string.
const size_type | CAPACITY
| The maximum number of elements in the string.
etl::flags< uint_least8_t > | flags

## Detailed Description

template<size_t MAX_SIZE_>
class etl::u16string< MAX_SIZE_ >

A u16string implementation that uses a fixed size buffer.

Template Parameters

  MAX_SIZE_ | The maximum number of elements that can be stored.

## Constructor & Destructor Documentation

## u16string() [1/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | const etl::u16string< MAX_SIZE_ > & | other | ) |

inline

Copy constructor.

Parameters

  other | The other string.

## u16string() [2/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | const etl::iu16string< MAX_SIZE_ > & | other | ) |

inline

From other iu16string.

Parameters

  other | The other iu16string.

## u16string() [3/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | const etl::iu16string< MAX_SIZE_ > & | other,
|  | size_type | position,
|  | size_type | length = npos )

inline

From other string, position, length.

Parameters

  other | The other string.
  position | The position of the first character.
  length | The number of characters. Default = npos.

## u16string() [4/8]

template<size_t MAX_SIZE_>

ETL_EXPLICIT_STRING_FROM_CHAR etl::u16string< MAX_SIZE_ >::u16string | ( | const value_type * | text | ) |

inline

Constructor, from null terminated text.

Parameters

  text | The initial text of the u16string.

## u16string() [5/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | const value_type * | text,
|  | size_type | count )

inline

Constructor, from null terminated text and count.

Parameters

  text | The initial text of the u16string.
  count | The number of characters to copy.

## u16string() [6/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | size_type | count,
|  | value_type | c )

inline

Constructor, from initial size and value.

Parameters

  initialSize | The initial size of the u16string.
  value | The value to fill the u16string with.

## u16string() [7/8]

template<size_t MAX_SIZE_>
template<typename TIterator>

etl::u16string< MAX_SIZE_ >::u16string | ( | TIterator | first,
|  | TIterator | last,
|  | typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type | = 0 )

inline

Constructor, from an iterator range.

Template Parameters

  TIterator | The iterator type.

Parameters

  first | The iterator to the first element.
  last | The iterator to the last element + 1.

## u16string() [8/8]

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ >::u16string | ( | const etl::u16string_view & | view | ) |

inline explicit

From string_view.

Parameters

  view | The string_view.

## Member Function Documentation

## substr()

template<size_t MAX_SIZE_>

etl::u16string< MAX_SIZE_ > etl::u16string< MAX_SIZE_ >::substr | ( | size_type | position = 0,
|  | size_type | length_ = npos ) const

inline

Returns a sub-string.

Parameters

  position | The position of the first character. Default = 0.
  length | The number of characters. Default = npos.

The documentation for this class was generated from the following file:

- include/etl/u16string.h