Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

string< MAX_SIZE_ > Class Template Reference

string< MAX_SIZE_ > Class Template Reference

A string implementation that uses a fixed size buffer. More...

#include <cstring.h>

Inherits etl::ibasic_string< char >.

Public Member Functions

 string ()
 Constructor.
 string (const etl::string< MAX_SIZE_ > &other)
 Copy constructor.
 string (const etl::string< MAX_SIZE_ > &other, size_t position, size_t length_=npos)
 From other string, position, length.
 string (const value_type *text)
 Constructor, from null terminated text.
 string (const value_type *text, size_t count)
 Constructor, from null terminated text and count.
 string (size_t count, value_type c)
 Constructor, from initial size and value.
template<typename TIterator >
 string (TIterator first, TIterator last)
 Constructor, from an iterator range.
etl::string< MAX_SIZE_ > substr (size_t position=0, size_t length_=npos) const
 Returns a sub-string.
stringoperator= (const string &rhs)
 Assignment operator.
void repair ()
 Fix the internal pointers after a low level memory copy.
iterator begin ()
 Returns an iterator to the beginning of the string.
const_iterator begin () const
 Returns a const_iterator to the beginning of the string.
iterator end ()
 Returns an iterator to the end of the string.
const_iterator end () const
 Returns a const_iterator to the end of the string.
const_iterator cbegin () const
 Returns a const_iterator to the beginning of the string.
const_iterator cend () const
 Returns a const_iterator to the end of the string.
reverse_iterator rbegin ()
 Returns an reverse iterator to the reverse beginning of the string.
const_reverse_iterator rbegin () const
 Returns a const reverse iterator to the reverse beginning of the string.
reverse_iterator rend ()
 Returns a reverse iterator to the end + 1 of the string.
const_reverse_iterator rend () const
 Returns a const reverse iterator to the end + 1 of the string.
const_reverse_iterator crbegin () const
 Returns a const reverse iterator to the reverse beginning of the string.
const_reverse_iterator crend () const
 Returns a const reverse iterator to the end + 1 of the string.
void resize (size_t new_size)
 Resizes the string.
void resize (size_t new_size, T value)
 Resizes the string.
reference operator[] (size_t i)
 Returns a reference to the value at index 'i'.
const_reference operator[] (size_t i) const
 Returns a const reference to the value at index 'i'.
reference at (size_t i)
 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.
const_reference at (size_t i) const
 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.
reference front ()
 Returns a reference to the first element.
const_reference front () const
 Returns a const reference to the first element.
reference back ()
 Returns a reference to the last element.
const_reference back () const
 Returns a const reference to the last element.
pointer data ()
 Returns a pointer to the beginning of the string data.
const_pointer data () const
 Returns a const pointer to the beginning of the string data.
void assign (const etl::ibasic_string< T > &other)
 Assigns values to the string.
void assign (const etl::ibasic_string< T > &other, size_t subposition, size_t sublength)
 Assigns values to the string.
void assign (const_pointer other)
 Assigns values to the string.
void assign (const_pointer other, size_t length_)
 Assigns values to the string.
template<typename TIterator >
void assign (TIterator first, TIterator last)
 Assigns values to the string.
void assign (size_t n, T value)
 Assigns values to the string.
void clear ()
 Clears the string.
void push_back (T value)
 Inserts a value at the end of the string.
void pop_back ()
 Removes an element from the end of the string.
ibasic_stringappend (const ibasic_string &str)
 Appends to the string.
ibasic_stringappend (const ibasic_string &str, size_t subposition, size_t sublength=npos)
 Appends to the string.
ibasic_stringappend (const T *str)
 Appends to the string.
ibasic_stringappend (const T *str, size_t n)
 Appends to the string.
ibasic_stringappend (size_t n, T c)
 Appends to the string.
template<class TIterator >
ibasic_stringappend (TIterator first, TIterator last)
 Appends to the string.
iterator insert (const_iterator position, T value)
 Inserts a value to the string.
void insert (const_iterator position, size_t n, T value)
 Inserts 'n' values to the string.
template<class TIterator >
void insert (iterator position, TIterator first, TIterator last)
 Inserts a range of values to the string.
etl::ibasic_string< T > & insert (size_t position, const etl::ibasic_string< T > &str)
 Inserts a string at the specified position.
etl::ibasic_string< T > & insert (size_t position, const etl::ibasic_string< T > &str, size_t subposition, size_t sublength)
 Inserts a string at the specified position from subposition for sublength.
etl::ibasic_string< T > & insert (size_t position, const_pointer s)
 Inserts a string at the specified position from pointer.
etl::ibasic_string< T > & insert (size_t position, const_pointer s, size_t n)
 Inserts a string at the specified position from pointer for n characters.
etl::ibasic_string< T > & insert (size_t position, size_t n, value_type c)
 Insert n characters of c at position.
etl::ibasic_string< T > & erase (size_t position, size_t length_=npos)
 Erases a sequence.
iterator erase (iterator i_element)
 Erases an element.
iterator erase (iterator first, iterator last)
 Erases a range of elements.
const_pointer c_str () const
 Return a pointer to a C string.
size_t copy (pointer s, size_t len, size_t pos=0)
 Copies a portion of a string.
size_t find (const ibasic_string< T > &str, size_t pos=0) const
 Find content within the string.
size_t find (const_pointer s, size_t pos=0) const
 Find content within the string.
size_t find (const_pointer s, size_t pos, size_t n) const
 Find content within the string.
size_t find (T c, size_t position=0) const
 Find character within the string.
size_t rfind (const ibasic_string< T > &str, size_t position=npos) const
 Find content within the string.
size_t rfind (const_pointer s, size_t position=npos) const
 Find content within the string.
size_t rfind (const_pointer s, size_t position, size_t length_) const
 Find content within the string.
size_t rfind (T c, size_t position=npos) const
 Find character within the string.
ibasic_stringreplace (size_t position, size_t length_, const ibasic_string &str)
 Replace 'length' characters from 'position' with 'str'.
ibasic_stringreplace (const_iterator first, const_iterator last, const ibasic_string &str)
 Replace characters from 'first' to one before 'last' with 'str'.
ibasic_stringreplace (size_t position, size_t length_, const ibasic_string &str, size_t subposition, size_t sublength)
 Replace characters from 'position' of 'length' with 'str' from 'subpsotion' of 'sublength'.
ibasic_stringreplace (size_t position, size_t length_, const_pointer s)
 Replace characters from 'position' of 'length' with pointed to string.
ibasic_stringreplace (const_iterator first, const_iterator last, const_pointer s)
 Replace characters from 'first' 'last' with pointed to string.
ibasic_stringreplace (size_t position, size_t length_, const_pointer s, size_t n)
 Replace characters from 'position' of 'length' with 'n' characters from pointed to string.
ibasic_stringreplace (const_iterator first, const_iterator last, const_pointer s, size_t n)
 Replace characters from 'first' to 'last' with 'n' characters from pointed to string.
ibasic_stringreplace (size_t position, size_t length_, size_t n, value_type c)
 Replace characters from 'position' of 'length' with 'n' copies of 'c'.
ibasic_stringreplace (const_iterator first, const_iterator last, size_t n, value_type c)
 Replace characters from 'first' of 'last' with 'n' copies of 'c'.
template<typename TIterator >
ibasic_stringreplace (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_t position, size_t length_, const ibasic_string &str) const
 Compare position / length with string.
int compare (size_t position, size_t length_, const ibasic_string &str, size_t subposition, size_t sublength) const
 Compare position / length with string / subposition / sublength.
int compare (const value_type *s) const
 Compare with C string.
int compare (size_t position, size_t length_, const_pointer s) const
 Compare position / length with C string.
int compare (size_t position, size_t length_, const_pointer s, size_t n) const
 Compare position / length with C string / n.
size_t find_first_of (const ibasic_string< T > &str, size_t position=0) const
 Find first of any of content within the string.
size_t find_first_of (const_pointer s, size_t position=0) const
 Find first of any of content within the string.
size_t find_first_of (const_pointer s, size_t position, size_t n) const
 Find first of any of content within the string.
size_t find_first_of (value_type c, size_t position=0) const
 Find first of character within the string.
size_t find_last_of (const ibasic_string< T > &str, size_t position=npos) const
 Find last of any of content within the string.
size_t find_last_of (const_pointer s, size_t position=npos) const
 Find last of any of content within the string.
size_t find_last_of (const_pointer s, size_t position, size_t n) const
 Find last of any of content within the string.
size_t find_last_of (value_type c, size_t position=npos) const
 Find last of character within the string.
size_t find_first_not_of (const ibasic_string< T > &str, size_t position=0) const
 Find first not of any of content within the string.
size_t find_first_not_of (const_pointer s, size_t position=0) const
 Find first not of any of content within the string.
size_t find_first_not_of (const_pointer s, size_t position, size_t n) const
 Find first not of any of content within the string.
size_t find_first_not_of (value_type c, size_t position=0) const
 Find first not of character within the string.
size_t find_last_not_of (const ibasic_string< T > &str, size_t position=npos) const
 Find last not of any of content within the string.
size_t find_last_not_of (const_pointer s, size_t position=npos) const
 Find last not of any of content within the string.
size_t find_last_not_of (const_pointer s, size_t position, size_t n) const
 Find last not of any of content within the string.
ibasic_stringoperator+= (const ibasic_string &rhs)
 += operator.
ibasic_stringoperator+= (const T *rhs)
 += operator.
ibasic_stringoperator+= (T rhs)
 += operator.
size_type size () const
 Gets the current size of the string.
size_type length () const
 Gets the current size of the string.
bool empty () const
 Checks the 'empty' state of the string.
bool full () const
 Checks the 'full' state of the string.
size_type capacity () const
 Returns the capacity of the string.
size_type max_size () const
 Returns the maximum possible size of the string.
size_t available () const
 Returns the remaining capacity.
size_t truncated () const
 Returns whether the string was truncated by the last operation.

Protected Member Functions

void repair (T *p_buffer_)
 Fix the internal pointers after a low level memory copy.
void initialise ()
 Initialise the string.

Protected Attributes

bool is_truncated
 Set to true if the operation truncated the string.
size_type current_size
 The current number of elements in the string.
const size_type CAPACITY
 The maximum number of elements in the string.

Detailed Description

template<const size_t MAX_SIZE_>
class etl::string< MAX_SIZE_ >

A string implementation that uses a fixed size buffer.

Template Parameters:
MAX_SIZE_The maximum number of elements that can be stored.

Definition at line 52 of file cstring.h.


Constructor & Destructor Documentation

string (  )

Constructor.

Definition at line 63 of file cstring.h.

string ( const etl::string< MAX_SIZE_ > &  other )

Copy constructor.

Parameters:
otherThe other string.

Definition at line 73 of file cstring.h.

string ( const etl::string< MAX_SIZE_ > &  other,
size_t  position,
size_t  length_ = npos 
)

From other string, position, length.

Parameters:
otherThe other string.
positionThe position of the first character.
lengthThe number of characters. Default = npos.

Definition at line 85 of file cstring.h.

string ( const value_type *  text )

Constructor, from null terminated text.

Parameters:
textThe initial text of the string.

Definition at line 100 of file cstring.h.

string ( const value_type *  text,
size_t  count 
)

Constructor, from null terminated text and count.

Parameters:
textThe initial text of the string.
countThe number of characters to copy.

Definition at line 111 of file cstring.h.

string ( size_t  count,
value_type  c 
)

Constructor, from initial size and value.

Parameters:
initialSizeThe initial size of the string.
valueThe value to fill the string with.

Definition at line 122 of file cstring.h.

string ( TIterator  first,
TIterator  last 
)

Constructor, from an iterator range.

Template Parameters:
TIteratorThe iterator type.
Parameters:
firstThe iterator to the first element.
lastThe iterator to the last element + 1.

Definition at line 136 of file cstring.h.


Member Function Documentation

ibasic_string& append ( const ibasic_string< T > &  str ) [inherited]

Appends to the string.

Parameters:
strThe string to append.

Definition at line 652 of file basic_string.h.

ibasic_string& append ( const ibasic_string< T > &  str,
size_t  subposition,
size_t  sublength = npos 
) [inherited]

Appends to the string.

Parameters:
strThe string to append.
subpositionThe position in str.
sublengthThe number of characters.

Definition at line 664 of file basic_string.h.

ibasic_string& append ( const T *  str ) [inherited]

Appends to the string.

Parameters:
strThe string to append.

Definition at line 676 of file basic_string.h.

ibasic_string& append ( const T *  str,
size_t  n 
) [inherited]

Appends to the string.

Parameters:
strThe string to append.
nThe number of characters.

Definition at line 687 of file basic_string.h.

ibasic_string& append ( size_t  n,
c 
) [inherited]

Appends to the string.

Parameters:
nThe number of characters.
cThe character.

Definition at line 698 of file basic_string.h.

ibasic_string& append ( TIterator  first,
TIterator  last 
) [inherited]

Appends to the string.

Parameters:
firstThe first of the characters to append.
lastThe last + 1 character to add.

Definition at line 710 of file basic_string.h.

void assign ( const etl::ibasic_string< T > &  other ) [inherited]

Assigns values to the string.

Truncates if the string does not have enough free space.

Parameters:
otherThe other string.

Definition at line 506 of file basic_string.h.

void assign ( TIterator  first,
TIterator  last 
) [inherited]

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.

Parameters:
firstThe iterator to the first element.
lastThe iterator to the last element + 1.

Definition at line 576 of file basic_string.h.

void assign ( size_t  n,
value 
) [inherited]

Assigns values to the string.

Truncates if the string does not have enough free space.

Parameters:
nThe number of elements to add.
valueThe value to insert for each element.

Definition at line 599 of file basic_string.h.

void assign ( const etl::ibasic_string< T > &  other,
size_t  subposition,
size_t  sublength 
) [inherited]

Assigns values to the string.

Truncates if the string does not have enough free space.

Parameters:
otherThe other string.
subpositionThe position to start from.
sublengthThe length to copy.

Definition at line 519 of file basic_string.h.

void assign ( const_pointer  other ) [inherited]

Assigns values to the string.

Truncates if the string does not have enough free space.

Parameters:
otherThe other string.

Definition at line 536 of file basic_string.h.

void assign ( const_pointer  other,
size_t  length_ 
) [inherited]

Assigns values to the string.

Truncates if the string does not have enough free space.

Parameters:
otherThe other string.
lengthThe length to copy.

Definition at line 556 of file basic_string.h.

const_reference at ( size_t  i ) const [inherited]

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.

Parameters:
iThe index.
Returns:
A const reference to the value at index 'i'

Definition at line 441 of file basic_string.h.

reference at ( size_t  i ) [inherited]

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.

Parameters:
iThe index.
Returns:
A reference to the value at index 'i'

Definition at line 429 of file basic_string.h.

size_t available (  ) const [inherited]

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 212 of file basic_string.h.

const_reference back (  ) const [inherited]

Returns a const reference to the last element.

Returns:
A const reference to the last element.

Definition at line 478 of file basic_string.h.

reference back (  ) [inherited]

Returns a reference to the last element.

Returns:
A reference to the last element.

Definition at line 469 of file basic_string.h.

iterator begin (  ) [inherited]

Returns an iterator to the beginning of the string.

Returns:
An iterator to the beginning of the string.

Definition at line 270 of file basic_string.h.

const_iterator begin (  ) const [inherited]

Returns a const_iterator to the beginning of the string.

Returns:
A const iterator to the beginning of the string.

Definition at line 279 of file basic_string.h.

const_pointer c_str (  ) const [inherited]

Return a pointer to a C string.

Definition at line 1016 of file basic_string.h.

size_type capacity (  ) const [inherited]

Returns the capacity of the string.

Returns:
The capacity of the string.

Definition at line 194 of file basic_string.h.

const_iterator cbegin (  ) const [inherited]

Returns a const_iterator to the beginning of the string.

Returns:
A const iterator to the beginning of the string.

Definition at line 306 of file basic_string.h.

const_iterator cend (  ) const [inherited]

Returns a const_iterator to the end of the string.

Returns:
A const iterator to the end of the string.

Definition at line 315 of file basic_string.h.

void clear (  ) [inherited]

Clears the string.

Definition at line 613 of file basic_string.h.

int compare ( const ibasic_string< T > &  str ) const [inherited]

Compare with string.

Definition at line 1459 of file basic_string.h.

int compare ( size_t  position,
size_t  length_,
const ibasic_string< T > &  str 
) const [inherited]

Compare position / length with string.

Definition at line 1470 of file basic_string.h.

int compare ( size_t  position,
size_t  length_,
const ibasic_string< T > &  str,
size_t  subposition,
size_t  sublength 
) const [inherited]

Compare position / length with string / subposition / sublength.

Definition at line 1486 of file basic_string.h.

int compare ( const value_type *  s ) const [inherited]

Compare with C string.

Definition at line 1504 of file basic_string.h.

int compare ( size_t  position,
size_t  length_,
const_pointer  s 
) const [inherited]

Compare position / length with C string.

Definition at line 1515 of file basic_string.h.

int compare ( size_t  position,
size_t  length_,
const_pointer  s,
size_t  n 
) const [inherited]

Compare position / length with C string / n.

Definition at line 1526 of file basic_string.h.

size_t copy ( pointer  s,
size_t  len,
size_t  pos = 0 
) [inherited]

Copies a portion of a string.

Parameters:
sPointer to the string to copy.
lenThe number of characters to copy.
posThe position to start copying from.

Definition at line 1027 of file basic_string.h.

const_reverse_iterator crbegin (  ) const [inherited]

Returns a const reverse iterator to the reverse beginning of the string.

Returns:
Const reverse iterator to the reverse beginning of the string.

Definition at line 360 of file basic_string.h.

const_reverse_iterator crend (  ) const [inherited]

Returns a const reverse iterator to the end + 1 of the string.

Returns:
Const reverse iterator to the end + 1 of the string.

Definition at line 369 of file basic_string.h.

const_pointer data (  ) const [inherited]

Returns a const pointer to the beginning of the string data.

Returns:
A const pointer to the beginning of the string data.

Definition at line 496 of file basic_string.h.

pointer data (  ) [inherited]

Returns a pointer to the beginning of the string data.

Returns:
A pointer to the beginning of the string data.

Definition at line 487 of file basic_string.h.

bool empty (  ) const [inherited]

Checks the 'empty' state of the string.

Returns:
true if empty.

Definition at line 176 of file basic_string.h.

const_iterator end (  ) const [inherited]

Returns a const_iterator to the end of the string.

Returns:
A const iterator to the end of the string.

Definition at line 297 of file basic_string.h.

iterator end (  ) [inherited]

Returns an iterator to the end of the string.

Returns:
An iterator to the end of the string.

Definition at line 288 of file basic_string.h.

iterator erase ( iterator  first,
iterator  last 
) [inherited]

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.

Parameters:
firstIterator to the first element.
lastIterator to the last element.
Returns:
An iterator pointing to the element that followed the erased element.

Definition at line 1002 of file basic_string.h.

etl::ibasic_string<T>& erase ( size_t  position,
size_t  length_ = npos 
) [inherited]

Erases a sequence.

Parameters:
positionPosition to start from.
lengthNumber of characters.
Returns:
A refernce to this string.

Definition at line 971 of file basic_string.h.

iterator erase ( iterator  i_element ) [inherited]

Erases an element.

Parameters:
i_elementIterator to the element.
Returns:
An iterator pointing to the element that followed the erased element.

Definition at line 986 of file basic_string.h.

size_t find ( const ibasic_string< T > &  str,
size_t  pos = 0 
) const [inherited]

Find content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1044 of file basic_string.h.

size_t find ( const_pointer  s,
size_t  pos = 0 
) const [inherited]

Find content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.

Definition at line 1068 of file basic_string.h.

size_t find ( const_pointer  s,
size_t  pos,
size_t  n 
) const [inherited]

Find content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.
nThe number of characters to search for.

Definition at line 1095 of file basic_string.h.

size_t find ( c,
size_t  position = 0 
) const [inherited]

Find character within the string.

Parameters:
cThe character to find.
positionThe position to start searching from.

Definition at line 1121 of file basic_string.h.

size_t find_first_not_of ( value_type  c,
size_t  position = 0 
) const [inherited]

Find first not of character within the string.

Parameters:
cThe character to not find
posThe position to start searching from.

Definition at line 1741 of file basic_string.h.

size_t find_first_not_of ( const ibasic_string< T > &  str,
size_t  position = 0 
) const [inherited]

Find first not of any of content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1689 of file basic_string.h.

size_t find_first_not_of ( const_pointer  s,
size_t  position = 0 
) const [inherited]

Find first not of any of content within the string.

Parameters:
sPointer to the content to not find
posThe position to start searching from.

Definition at line 1699 of file basic_string.h.

size_t find_first_not_of ( const_pointer  s,
size_t  position,
size_t  n 
) const [inherited]

Find first not of any of content within the string.

Parameters:
sPointer to the content to not find
posThe position to start searching from.
nThe number of characters to search for.

Definition at line 1710 of file basic_string.h.

size_t find_first_of ( value_type  c,
size_t  position = 0 
) const [inherited]

Find first of character within the string.

Parameters:
cThe character to find
posThe position to start searching from.

Definition at line 1584 of file basic_string.h.

size_t find_first_of ( const ibasic_string< T > &  str,
size_t  position = 0 
) const [inherited]

Find first of any of content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1539 of file basic_string.h.

size_t find_first_of ( const_pointer  s,
size_t  position = 0 
) const [inherited]

Find first of any of content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.

Definition at line 1549 of file basic_string.h.

size_t find_first_of ( const_pointer  s,
size_t  position,
size_t  n 
) const [inherited]

Find first of any of content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.
nThe number of characters to search for.

Definition at line 1560 of file basic_string.h.

size_t find_last_not_of ( const ibasic_string< T > &  str,
size_t  position = npos 
) const [inherited]

Find last not of any of content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1762 of file basic_string.h.

size_t find_last_not_of ( const_pointer  s,
size_t  position = npos 
) const [inherited]

Find last not of any of content within the string.

Parameters:
sThe pointer to the content to find
posThe position to start searching from.

Definition at line 1772 of file basic_string.h.

size_t find_last_not_of ( const_pointer  s,
size_t  position,
size_t  n 
) const [inherited]

Find last not of any of content within the string.

Parameters:
sThe pointer to the content to find
posThe position to start searching from.
nThe number of characters to use.

Definition at line 1783 of file basic_string.h.

size_t find_last_of ( value_type  c,
size_t  position = npos 
) const [inherited]

Find last of character within the string.

Parameters:
cThe character to find
posThe position to start searching from.

Definition at line 1659 of file basic_string.h.

size_t find_last_of ( const ibasic_string< T > &  str,
size_t  position = npos 
) const [inherited]

Find last of any of content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1605 of file basic_string.h.

size_t find_last_of ( const_pointer  s,
size_t  position = npos 
) const [inherited]

Find last of any of content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.

Definition at line 1615 of file basic_string.h.

size_t find_last_of ( const_pointer  s,
size_t  position,
size_t  n 
) const [inherited]

Find last of any of content within the string.

Parameters:
sPointer to the content to find
posThe position to start searching from.
nThe number of characters to search for.

Definition at line 1626 of file basic_string.h.

reference front (  ) [inherited]

Returns a reference to the first element.

Returns:
A reference to the first element.

Definition at line 451 of file basic_string.h.

const_reference front (  ) const [inherited]

Returns a const reference to the first element.

Returns:
A const reference to the first element.

Definition at line 460 of file basic_string.h.

bool full (  ) const [inherited]

Checks the 'full' state of the string.

Returns:
true if full.

Definition at line 185 of file basic_string.h.

void initialise (  ) [protected, inherited]

Initialise the string.

Definition at line 1913 of file basic_string.h.

etl::ibasic_string<T>& insert ( size_t  position,
size_t  n,
value_type  c 
) [inherited]

Insert n characters of c at position.

Parameters:
positionThe position to insert before.
nThe number of characters to insert.
cThe character to insert.

Definition at line 957 of file basic_string.h.

etl::ibasic_string<T>& insert ( size_t  position,
const etl::ibasic_string< T > &  str 
) [inherited]

Inserts a string at the specified position.

Parameters:
positionThe position to insert before.
strThe string to insert.

Definition at line 895 of file basic_string.h.

iterator insert ( const_iterator  position,
value 
) [inherited]

Inserts a value to the string.

Parameters:
positionThe position to insert before.
valueThe value to insert.

Definition at line 721 of file basic_string.h.

etl::ibasic_string<T>& insert ( size_t  position,
const_pointer  s 
) [inherited]

Inserts a string at the specified position from pointer.

Parameters:
positionThe position to insert before.
sThe string to insert.

Definition at line 929 of file basic_string.h.

etl::ibasic_string<T>& insert ( size_t  position,
const_pointer  s,
size_t  n 
) [inherited]

Inserts a string at the specified position from pointer for n characters.

Parameters:
positionThe position to insert before.
sThe string to insert.
nThe number of characters to insert.

Definition at line 943 of file basic_string.h.

void insert ( const_iterator  position,
size_t  n,
value 
) [inherited]

Inserts 'n' values to the string.

Parameters:
positionThe position to insert before.
nThe number of elements to add.
valueThe value to insert.

Definition at line 769 of file basic_string.h.

void insert ( iterator  position,
TIterator  first,
TIterator  last 
) [inherited]

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.

Parameters:
positionThe position to insert before.
firstThe first element to add.
lastThe last + 1 element to add.

Definition at line 830 of file basic_string.h.

etl::ibasic_string<T>& insert ( size_t  position,
const etl::ibasic_string< T > &  str,
size_t  subposition,
size_t  sublength 
) [inherited]

Inserts a string at the specified position from subposition for sublength.

Parameters:
positionThe position to insert before.
strThe string to insert.
subpositionThe subposition to start from.
sublengthThe number of characters to insert.

Definition at line 910 of file basic_string.h.

size_type length (  ) const [inherited]

Gets the current size of the string.

Returns:
The current size of the string.

Definition at line 167 of file basic_string.h.

size_type max_size (  ) const [inherited]

Returns the maximum possible size of the string.

Returns:
The maximum size of the string.

Definition at line 203 of file basic_string.h.

ibasic_string& operator+= ( const T *  rhs ) [inherited]

+= operator.

Definition at line 1875 of file basic_string.h.

ibasic_string& operator+= ( const ibasic_string< T > &  rhs ) [inherited]

+= operator.

Definition at line 1862 of file basic_string.h.

ibasic_string& operator+= ( rhs ) [inherited]

+= operator.

Definition at line 1885 of file basic_string.h.

string& operator= ( const string< MAX_SIZE_ > &  rhs )

Assignment operator.

Definition at line 166 of file cstring.h.

const_reference operator[] ( size_t  i ) const [inherited]

Returns a const reference to the value at index 'i'.

Parameters:
iThe index.
Returns:
A const reference to the value at index 'i'

Definition at line 418 of file basic_string.h.

reference operator[] ( size_t  i ) [inherited]

Returns a reference to the value at index 'i'.

Parameters:
iThe index.
Returns:
A reference to the value at index 'i'

Definition at line 408 of file basic_string.h.

void pop_back (  ) [inherited]

Removes an element from the end of the string.

Does nothing if the string is empty.

Definition at line 640 of file basic_string.h.

void push_back ( value ) [inherited]

Inserts a value at the end of the string.

Sets 'truncated' if the string is already full.

Parameters:
valueThe value to add.

Definition at line 623 of file basic_string.h.

const_reverse_iterator rbegin (  ) const [inherited]

Returns a const reverse iterator to the reverse beginning of the string.

Returns:
Const iterator to the reverse beginning of the string.

Definition at line 333 of file basic_string.h.

reverse_iterator rbegin (  ) [inherited]

Returns an reverse iterator to the reverse beginning of the string.

Returns:
Iterator to the reverse beginning of the string.

Definition at line 324 of file basic_string.h.

const_reverse_iterator rend (  ) const [inherited]

Returns a const reverse iterator to the end + 1 of the string.

Returns:
Const reverse iterator to the end + 1 of the string.

Definition at line 351 of file basic_string.h.

reverse_iterator rend (  ) [inherited]

Returns a reverse iterator to the end + 1 of the string.

Returns:
Reverse iterator to the end + 1 of the string.

Definition at line 342 of file basic_string.h.

void repair (  ) [virtual]

Fix the internal pointers after a low level memory copy.

Implements ibasic_string< T >.

Definition at line 179 of file cstring.h.

void repair ( T *  p_buffer_ ) [protected, inherited]

Fix the internal pointers after a low level memory copy.

Definition at line 1922 of file basic_string.h.

ibasic_string& replace ( const_iterator  first,
const_iterator  last,
const_pointer  s 
) [inherited]

Replace characters from 'first' 'last' with pointed to string.

Definition at line 1348 of file basic_string.h.

ibasic_string& replace ( const_iterator  first,
const_iterator  last,
const_pointer  s,
size_t  n 
) [inherited]

Replace characters from 'first' to 'last' with 'n' characters from pointed to string.

Definition at line 1385 of file basic_string.h.

ibasic_string& replace ( size_t  position,
size_t  length_,
size_t  n,
value_type  c 
) [inherited]

Replace characters from 'position' of 'length' with 'n' copies of 'c'.

Definition at line 1403 of file basic_string.h.

ibasic_string& replace ( const_iterator  first,
const_iterator  last,
const ibasic_string< T > &  str 
) [inherited]

Replace characters from 'first' to one before 'last' with 'str'.

Parameters:
firstThe position to start from.
lastThe one after the position to end at.
strThe string to replace it with.

Definition at line 1290 of file basic_string.h.

ibasic_string& replace ( const_iterator  first,
const_iterator  last,
size_t  n,
value_type  c 
) [inherited]

Replace characters from 'first' of 'last' with 'n' copies of 'c'.

Definition at line 1422 of file basic_string.h.

ibasic_string& replace ( size_t  position,
size_t  length_,
const ibasic_string< T > &  str,
size_t  subposition,
size_t  sublength 
) [inherited]

Replace characters from 'position' of 'length' with 'str' from 'subpsotion' of 'sublength'.

Definition at line 1308 of file basic_string.h.

ibasic_string& replace ( size_t  position,
size_t  length_,
const_pointer  s,
size_t  n 
) [inherited]

Replace characters from 'position' of 'length' with 'n' characters from pointed to string.

Definition at line 1366 of file basic_string.h.

ibasic_string& replace ( const_iterator  first,
const_iterator  last,
TIterator  first_replace,
TIterator  last_replace 
) [inherited]

Replace characters from 'first' of 'last' with characters from 'first_replace' to 'last_replace'.

Definition at line 1441 of file basic_string.h.

ibasic_string& replace ( size_t  position,
size_t  length_,
const ibasic_string< T > &  str 
) [inherited]

Replace 'length' characters from 'position' with 'str'.

Parameters:
positionThe position to start from.
lengthThe number of characters to replace.
strThe string to replace it with.

Definition at line 1268 of file basic_string.h.

ibasic_string& replace ( size_t  position,
size_t  length_,
const_pointer  s 
) [inherited]

Replace characters from 'position' of 'length' with pointed to string.

Definition at line 1329 of file basic_string.h.

void resize ( size_t  new_size ) [inherited]

Resizes the string.

If asserts or exceptions are enabled and the new size is larger than the

Parameters:
new_sizeThe new size.

Definition at line 379 of file basic_string.h.

void resize ( size_t  new_size,
value 
) [inherited]

Resizes the string.

Parameters:
new_sizeThe new size.
valueThe value to fill new elements with. Default = default constructed value.

Definition at line 389 of file basic_string.h.

size_t rfind ( const ibasic_string< T > &  str,
size_t  position = npos 
) const [inherited]

Find content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1140 of file basic_string.h.

size_t rfind ( const_pointer  s,
size_t  position = npos 
) const [inherited]

Find content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1171 of file basic_string.h.

size_t rfind ( const_pointer  s,
size_t  position,
size_t  length_ 
) const [inherited]

Find content within the string.

Parameters:
strThe content to find
posThe position to start searching from.

Definition at line 1207 of file basic_string.h.

size_t rfind ( c,
size_t  position = npos 
) const [inherited]

Find character within the string.

Parameters:
cThe character to find
posThe position to start searching from.

Definition at line 1241 of file basic_string.h.

size_type size (  ) const [inherited]

Gets the current size of the string.

Returns:
The current size of the string.

Definition at line 158 of file basic_string.h.

etl::string<MAX_SIZE_> substr ( size_t  position = 0,
size_t  length_ = npos 
) const

Returns a sub-string.

Parameters:
positionThe position of the first character. Default = 0.
lengthThe number of characters. Default = npos.

Definition at line 147 of file cstring.h.

size_t truncated (  ) const [inherited]

Returns whether the string was truncated by the last operation.

Returns:
Whether the string was truncated by the last operation.

Definition at line 221 of file basic_string.h.


Field Documentation

const size_type CAPACITY [protected, inherited]

The maximum number of elements in the string.

Definition at line 240 of file basic_string.h.

size_type current_size [protected, inherited]

The current number of elements in the string.

Definition at line 239 of file basic_string.h.

bool is_truncated [protected, inherited]

Set to true if the operation truncated the string.

Definition at line 238 of file basic_string.h.