|
MoSync 3.2.1
|
A class that holds the actual data used by String. More...
#include <MAUtil/String.h>
Public Types | |
| typedef Tchar * | iterator |
| Defines a typesafe iterator for the template instance. | |
| typedef const Tchar * | const_iterator |
Public Member Functions | |
| StringData (const Tchar *text) | |
| StringData (const Tchar *text, int len) | |
| StringData (int len) | |
| StringData (const StringData &other) | |
| virtual | ~StringData () |
| void | add (const Tchar &val) |
| Adds an element to the end of the Vector. | |
| void | add (const Tchar *ptr, int num) |
| Adds several elements to the end of the Vector. | |
| void | remove (iterator i) |
| Removes the element pointed to by iterator i. | |
| void | remove (int index) |
| Removes the element at index. | |
| void | remove (int index, int number) |
| Removes several elements, starting at index. | |
| void | insert (int index, Tchart) |
| Inserts the element at index, moving all existing elements beginning at 'index' one step forward. | |
| int | size () const |
| Returns the number of elements. | |
| void | resize (int newSize) |
| Resizes the Vector to contain size elements. | |
| void | reserve (int newCapacity) |
| Reserves space in the Vector. | |
| void | clear () |
| Clears the Vector, setting its size to 0 but not altering its capacity. | |
| bool | empty () const |
| Returns true iff the Vector is empty(). | |
| int | capacity () const |
| Returns the Vector's current capacity. | |
| iterator | begin () |
| Returns an iterator pointing to the first element of the Vector. | |
| const_iterator | begin () const |
| Returns an iterator pointing to the first element of the Vector. | |
| iterator | end () |
| Returns an iterator pointing beyond the last element of the Vector. | |
| const_iterator | end () const |
| Returns an iterator pointing beyond the last element of the Vector. | |
| Tchar & | operator[] (int index) |
| Returns a reference to the element at index. No range-checking is done. | |
| const Tchar & | operator[] (int index) const |
| Returns a const reference to the element at index. No range-checking is done. | |
| const Tchar * | pointer () const |
| Returns a const pointer to the Vector's storage array. | |
| Tchar * | pointer () |
| Returns a pointer to the Vector's storage array. | |
| void | addRef () |
| Increments the reference count by one. | |
| void | release () |
| Decrements the reference count by one. | |
| int | getRefCount () |
| Returns the current reference count. | |
Protected Attributes | |
| int | mSize |
| int | mCapacity |
| Tchar * | mData |
Friends | |
| class | BasicString |
A class that holds the actual data used by String.
It's a reference counted vector.
typedef Tchar * MAUtil::Vector< Tchar >::iterator [inherited] |
Defines a typesafe iterator for the template instance.
typedef const Tchar * MAUtil::Vector< Tchar >::const_iterator [inherited] |
| MAUtil::StringData< Tchar >::StringData | ( | const Tchar * | text | ) |
| MAUtil::StringData< Tchar >::StringData | ( | const Tchar * | text, |
| int | len | ||
| ) |
| MAUtil::StringData< Tchar >::StringData | ( | int | len | ) |
| MAUtil::StringData< Tchar >::StringData | ( | const StringData< Tchar > & | other | ) |
| virtual MAUtil::StringData< Tchar >::~StringData | ( | ) | [inline, virtual] |
| void MAUtil::Vector< Tchar >::add | ( | const Tchar & | val | ) | [inline, inherited] |
Adds an element to the end of the Vector.
| val | The element to be added. |
| void MAUtil::Vector< Tchar >::add | ( | const Tchar * | ptr, |
| int | num | ||
| ) | [inline, inherited] |
Adds several elements to the end of the Vector.
| ptr | A pointer to the elements. |
| num | The number of elements. |
| void MAUtil::Vector< Tchar >::remove | ( | iterator | i | ) | [inline, inherited] |
Removes the element pointed to by iterator i.
| i | An iterator pointing to the element that should be removed. |
| void MAUtil::Vector< Tchar >::remove | ( | int | index | ) | [inline, inherited] |
Removes the element at index.
| index | The index of the element that should be removed. |
| void MAUtil::Vector< Tchar >::remove | ( | int | index, |
| int | number | ||
| ) | [inline, inherited] |
Removes several elements, starting at index.
| index | The index of the element that should be removed. |
| number | The number of elements to remove. |
| void MAUtil::Vector< Tchar >::insert | ( | int | index, |
| Tchar | t | ||
| ) | [inline, inherited] |
Inserts the element at index, moving all existing elements beginning at 'index' one step forward.
| index | The index of the newly inserted element. |
| t | The element itself. |
| int MAUtil::Vector< Tchar >::size | ( | ) | const [inline, inherited] |
Returns the number of elements.
| void MAUtil::Vector< Tchar >::resize | ( | int | newSize | ) | [inline, inherited] |
Resizes the Vector to contain size elements.
| newSize | The desired size of the Vector. |
| void MAUtil::Vector< Tchar >::reserve | ( | int | newCapacity | ) | [inline, inherited] |
Reserves space in the Vector.
| newCapacity | The desired capacity of the Vector. |
| void MAUtil::Vector< Tchar >::clear | ( | ) | [inline, inherited] |
Clears the Vector, setting its size to 0 but not altering its capacity.
| bool MAUtil::Vector< Tchar >::empty | ( | ) | const [inline, inherited] |
Returns true iff the Vector is empty().
| int MAUtil::Vector< Tchar >::capacity | ( | ) | const [inline, inherited] |
Returns the Vector's current capacity.
| iterator MAUtil::Vector< Tchar >::begin | ( | ) | [inline, inherited] |
Returns an iterator pointing to the first element of the Vector.
| const_iterator MAUtil::Vector< Tchar >::begin | ( | ) | const [inline, inherited] |
Returns an iterator pointing to the first element of the Vector.
| iterator MAUtil::Vector< Tchar >::end | ( | ) | [inline, inherited] |
Returns an iterator pointing beyond the last element of the Vector.
| const_iterator MAUtil::Vector< Tchar >::end | ( | ) | const [inline, inherited] |
Returns an iterator pointing beyond the last element of the Vector.
| Tchar & MAUtil::Vector< Tchar >::operator[] | ( | int | index | ) | [inline, inherited] |
Returns a reference to the element at index. No range-checking is done.
| index | The index of the element to be returned. |
| const Tchar & MAUtil::Vector< Tchar >::operator[] | ( | int | index | ) | const [inline, inherited] |
Returns a const reference to the element at index. No range-checking is done.
| index | The index of the element to be returned. |
| const Tchar * MAUtil::Vector< Tchar >::pointer | ( | ) | const [inline, inherited] |
Returns a const pointer to the Vector's storage array.
| Tchar * MAUtil::Vector< Tchar >::pointer | ( | ) | [inline, inherited] |
Returns a pointer to the Vector's storage array.
| void MAUtil::RefCounted::addRef | ( | ) | [inherited] |
Increments the reference count by one.
| void MAUtil::RefCounted::release | ( | ) | [inherited] |
Decrements the reference count by one.
| int MAUtil::RefCounted::getRefCount | ( | ) | [inherited] |
Returns the current reference count.
friend class BasicString [friend] |
int MAUtil::Vector< Tchar >::mSize [protected, inherited] |
int MAUtil::Vector< Tchar >::mCapacity [protected, inherited] |
Tchar * MAUtil::Vector< Tchar >::mData [protected, inherited] |