Embedded Template Library 1.0
|
#include <basic_string.h>
Public Types | |
typedef ibasic_string< T > | interface_type |
typedef T | value_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T * | iterator |
typedef const 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 |
![]() | |
typedef size_t | size_type |
![]() | |
typedef size_t | size_type |
Public Member Functions | |
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, T value) |
void | uninitialized_resize (size_type new_size) |
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 () |
const_pointer | data () const |
pointer | data_end () |
const_pointer | data_end () const |
void | assign (const etl::ibasic_string< T > &other) |
void | assign (const etl::ibasic_string< T > &other, size_type subposition, size_type sublength) |
void | assign (const_pointer other) |
void | assign (const_pointer other, size_type length_) |
template<typename TIterator > | |
void | assign (TIterator first, TIterator last) |
void | assign (size_type n, T value) |
void | clear () |
Clears the string. | |
void | push_back (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 (const T *str) |
ibasic_string & | append (const T *str, size_type n) |
ibasic_string & | append (size_type n, T c) |
template<class TIterator > | |
ibasic_string & | append (TIterator first, TIterator last) |
iterator | insert (const_iterator position, T value) |
iterator | insert (const_iterator position, size_type n, T value) |
template<typename TIterator > | |
iterator | insert (const_iterator position, TIterator first, TIterator last) |
etl::ibasic_string< T > & | insert (size_type position, const etl::ibasic_string< T > &str) |
etl::ibasic_string< T > & | insert (size_type position, const etl::ibasic_string< T > &str, size_type subposition, size_type sublength) |
etl::ibasic_string< T > & | insert (size_type position, const_pointer s) |
etl::ibasic_string< T > & | insert (size_type position, const_pointer s, size_type n) |
etl::ibasic_string< T > & | insert (size_type position, size_type n, value_type c) |
etl::ibasic_string< 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< T > &str, 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 (T c, size_type position=0) const |
size_type | rfind (const ibasic_string< T > &str, size_type position=npos) 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 (T c, size_type position=npos) const |
ibasic_string & | replace (size_type position, size_type length_, const ibasic_string &str) |
ibasic_string & | replace (const_iterator first, const_iterator last, const ibasic_string &str) |
ibasic_string & | replace (size_type position, size_type length_, const ibasic_string &str, size_type subposition, size_type sublength) |
Replace characters from 'position' of 'length' with 'str' from 'subposition' of '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) |
Replace characters from 'first' 'last' with pointed to string. | |
ibasic_string & | replace (size_type position, size_type length_, const_pointer s, size_type n) |
Replace characters from 'position' of 'length' with 'n' characters from pointed to string. | |
ibasic_string & | replace (const_iterator first, const_iterator last, const_pointer s, size_type n) |
Replace characters from 'first' to 'last' with 'n' characters from pointed to string. | |
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'. | |
template<typename TIterator > | |
ibasic_string & | replace (const_iterator first, const_iterator last, TIterator first_replace, TIterator last_replace) |
Replace characters from 'first' of 'last' with characters from 'first_replace' to 'last_replace'. | |
int | compare (const ibasic_string &str) const |
Compare with string. | |
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 ibasic_string &str, size_type subposition, size_type sublength) const |
Compare position / length with string / subposition / sublength. | |
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< 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_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< 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_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< 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_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< 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_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 ibasic_string &rhs) |
+= operator. | |
ibasic_string & | operator+= (const_pointer rhs) |
+= operator. | |
ibasic_string & | operator+= (T rhs) |
+= operator. | |
void | initialize_free_space () |
Clears the free space to string terminator value. | |
void | trim_to_terminator () |
![]() | |
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 |
ETL_DEPRECATED bool | truncated () const |
bool | is_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. | |
Protected Member Functions | |
ibasic_string (T *p_buffer_, size_type MAX_SIZE_) | |
Constructor. | |
void | initialise () |
Initialise the string. | |
void | repair_buffer (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. | |
![]() | |
string_base (size_type max_size_) | |
Constructor. | |
void | set_truncated (bool status) |
Sets the 'truncated' flag. | |
~string_base () | |
Destructor. | |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
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 |
The base class for specifically sized strings. Can be used as a reference type for all strings containing a specific type.
|
inline |
Appends to the string.
str | The string to append. |
|
inline |
Appends to the string.
str | The string to append. |
subposition | The position in str. |
sublength | The number of characters. |
|
inline |
Appends to the string.
str | The string to append. |
|
inline |
Appends to the string.
str | The string to append. |
n | The number of characters. |
|
inline |
Appends to the string.
n | The number of characters. |
c | The character. |
|
inline |
Appends to the string.
first | The first of the characters to append. |
last | The last + 1 character to add. |
|
inline |
Assigns values to the string. Truncates if the string does not have enough free space.
other | The other string. |
|
inline |
Assigns values to the string. Truncates if the string does not have enough free space.
other | The other string. |
subposition | The position to start from. |
sublength | The length to copy. |
|
inline |
Assigns values to the string. Truncates if the string does not have enough free space.
other | The other string. |
|
inline |
Assigns values to the string. Truncates if the string does not have enough free space.
other | The other string. |
length | The length to copy. |
|
inline |
Assigns values to the string. Truncates if the string does not have enough free space.
n | The number of elements to add. |
value | The value to insert for each element. |
|
inline |
Assigns values to the string. If asserts or exceptions are enabled, emits string_iterator if the iterators are reversed. Truncates if the string does not have enough free space.
first | The iterator to the first element. |
last | The iterator to the last element + 1. |
|
inline |
Returns a reference to the value at index 'i' If asserts or exceptions are enabled, emits an etl::string_out_of_bounds if the index is out of range.
i | The index. |
|
inline |
Returns a const reference to the value at index 'i' If asserts or exceptions are enabled, emits an etl::string_out_of_bounds if the index is out of range.
i | The index. |
|
inline |
Returns a reference to the last element.
|
inline |
Returns a const reference to the last element.
|
inline |
Returns an iterator to the beginning of the string.
|
inline |
Returns a const_iterator to the beginning of the string.
|
inline |
Returns a const_iterator to the beginning of the string.
|
inline |
Returns a const_iterator to the end of the string.
|
inline |
Copies a portion of a string.
dest | Pointer to the destination buffer. |
count | The number of characters to copy. |
pos | The position to start copying from. |
|
inline |
Returns a const reverse iterator to the reverse beginning of the string.
|
inline |
Returns a const reverse iterator to the end + 1 of the string.
|
inline |
Returns a pointer to the beginning of the string data.
|
inline |
Returns a const pointer to the beginning of the string data.
|
inline |
Returns a pointer to the beginning of the string data.
|
inline |
Returns a const pointer to the beginning of the string data.
|
inline |
Returns an iterator to the end of the string.
|
inline |
Returns a const_iterator to the end of the string.
|
inline |
Erases a range of elements. The range includes all the elements between first and last, including the element pointed by first, but not the one pointed by last.
first | Iterator to the first element. |
last | Iterator to the last element. |
|
inline |
Erases an element.
i_element | Iterator to the element. |
|
inline |
Erases an element.
i_element | Iterator to the element. |
|
inline |
Erases a sequence.
position | Position to start from. |
length | Number of characters. |
|
inline |
Find content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
n | The number of characters to search for. |
|
inline |
Find content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
|
inline |
Find character within the string
c | The character to find. |
position | The position to start searching from. |
|
inline |
Find first not of any of content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find first not of any of content within the string
s | Pointer to the content to not find |
pos | The position to start searching from. |
n | The number of characters to search for. |
|
inline |
Find first not of any of content within the string
s | Pointer to the content to not find |
pos | The position to start searching from. |
|
inline |
Find first not of character within the string
c | The character to not find |
pos | The position to start searching from. |
|
inline |
Find first of any of content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find first of any of content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
n | The number of characters to search for. |
|
inline |
Find first of any of content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
|
inline |
Find first of character within the string
c | The character to find |
pos | The position to start searching from. |
|
inline |
Find last not of any of content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find last not of any of content within the string
s | The pointer to the content to find |
pos | The position to start searching from. |
n | The number of characters to use. |
|
inline |
Find last not of any of content within the string
s | The pointer to the content to find |
pos | The position to start searching from. |
|
inline |
Find last of any of content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find last of any of content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
n | The number of characters to search for. |
|
inline |
Find last of any of content within the string
s | Pointer to the content to find |
pos | The position to start searching from. |
|
inline |
Find last of character within the string
c | The character to find |
pos | The position to start searching from. |
|
inline |
Returns a reference to the first element.
|
inline |
Returns a const reference to the first element.
|
inline |
Inserts 'n' values to the string.
position | The position to insert before. |
n | The number of elements to add. |
value | The value to insert. |
|
inline |
Inserts a value to the string.
position | The position to insert before. |
value | The value to insert. |
|
inline |
Inserts a range of values to the string. If asserts or exceptions are enabled, emits string_full if the string does not have enough free space.
position | The position to insert before. |
first | The first element to add. |
last | The last + 1 element to add. |
|
inline |
Inserts a string at the specified position.
position | The position to insert before. |
str | The string to insert. |
|
inline |
Inserts a string at the specified position from subposition for sublength.
position | The position to insert before. |
str | The string to insert. |
subposition | The subposition to start from. |
sublength | The number of characters to insert. |
|
inline |
Inserts a string at the specified position from pointer.
position | The position to insert before. |
s | The string to insert. |
|
inline |
Inserts a string at the specified position from pointer for n characters.
position | The position to insert before. |
s | The string to insert. |
n | The number of characters to insert. |
|
inline |
Insert n characters of c at position.
position | The position to insert before. |
n | The number of characters to insert. |
c | The character to insert. |
|
inline |
Returns a reference to the value at index 'i'
i | The index. |
|
inline |
Returns a const reference to the value at index 'i'
i | The index. |
|
inline |
Removes an element from the end of the string. Does nothing if the string is empty.
|
inline |
Inserts a value at the end of the string. Sets 'truncated' if the string is already full.
value | The value to add. |
|
inline |
Returns an reverse iterator to the reverse beginning of the string.
|
inline |
Returns a const reverse iterator to the reverse beginning of the string.
|
inline |
Returns a reverse iterator to the end + 1 of the string.
|
inline |
Returns a const reverse iterator to the end + 1 of the string.
|
inline |
Replace characters from 'first' to one before 'last' with 'str'.
first | The position to start from. |
last | The one after the position to end at. |
str | The string to replace it with. |
|
inline |
Replace 'length' characters from 'position' with 'str'.
position | The position to start from. |
length | The number of characters to replace. |
str | The string to replace it with. |
|
inline |
Resizes the string. If asserts or exceptions are enabled and the new size is larger than the
new_size | The new size. |
|
inline |
Resizes the string.
new_size | The new size. |
value | The value to fill new elements with. Default = default constructed value. |
|
inline |
Find content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find content within the string
str | The content to find |
pos | The position to start searching from. |
|
inline |
Find character within the string
c | The character to find |
pos | The position to start searching from. |
|
inline |
Trim the size to the distance to the first null terminator. If the last buffer position has a non-null value then the truncated flag will be set.
|
inline |
Resizes the string, but doesn't initialise the free space except for a terminator null.
new_size | The new size. |