ADTF
|
Stacked String. More...
Public Types | |
typedef stack_string_base< TSIZE, datastoreType > | _myType |
definition my type | |
typedef stack_string_data< TSIZE, datastoreType > | _myBase |
definition my base | |
typedef _myBase::value_type | value_type |
definition value type | |
typedef _myBase::size_type | size_type |
definition size type | |
typedef simple_pointer_iterator< value_type > | iterator |
short typedefinition for string iterators | |
typedef simple_pointer_iterator< const value_type > | const_iterator |
short typedefinition for string const_iterators | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
short typedefinition for string reverse iterators | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
short typedefinition for string reverse const_iterators | |
![]() | |
typedef datastoreHandler::value_type | value_type |
short typedefinition for value_type | |
typedef datastoreHandler::size_type | size_type |
short typedefinition for size_type | |
Public Member Functions | |
stack_string_base () | |
Constructor. | |
stack_string_base (const _myType &strValue) | |
Constructor. | |
stack_string_base & | operator= (const _myType &strValue) |
String assignement. | |
template<tSize T2, typename dT2 > | |
stack_string_base (const stack_string_base< T2, dT2 > &strValue) | |
Constructor. | |
template<tSize T2, typename dT2 > | |
stack_string_base & | operator= (const stack_string_base< T2, dT2 > &strValue) |
String assignement. | |
stack_string_base (_myType &&strValue) | |
Constructor. | |
stack_string_base & | operator= (_myType &&strValue) |
Assignment operator. More... | |
template<tSize T2, typename dT2 > | |
stack_string_base (stack_string_base< T2, dT2 > &&strValue) | |
Constructor. | |
template<tSize T2, typename dT2 > | |
stack_string_base & | operator= (stack_string_base< T2, dT2 > &&strValue) |
Assignment operator. More... | |
~stack_string_base () | |
Destructor. | |
iterator | begin () |
Return iterator to beginning. | |
iterator | end () |
Return iterator to end. | |
reverse_iterator | rbegin () |
Return reverse iterator to reverse beginning. | |
reverse_iterator | rend () |
Return reverse iterator to reverse end. | |
const_iterator | cbegin () const |
Return const_iterator to beginning. | |
const_iterator | cend () const |
Return const_iterator to end. | |
const_reverse_iterator | crbegin () const |
Return reverse const_iterator to reverse beginning. | |
const_reverse_iterator | crend () const |
Return reverse const_iterator to reverse end. | |
const value_type * | c_str () const |
Get C string. | |
size_type | length () const |
Return length of string. | |
tVoid | clear () |
Clear string content. | |
_myType & | append (size_type szCount, value_type c) |
Appends szCount consecutive copies of character c. More... | |
template<tSize T2, typename dT2 > | |
_myType & | append (const stack_string_base< T2, dT2 > &strValue, size_type nPos, size_type nLength) |
Appends a copy of a substring of strValue. More... | |
template<tSize T2, typename dT2 > | |
_myType & | append (const stack_string_base< T2, dT2 > &strValue, size_type nLength=InvalidPos) |
Appends a copy of of the first nLength characters of strValue. More... | |
template<tSize T2, typename dT2 > | |
_myType & | assign (const stack_string_base< T2, dT2 > &strValue) |
Assigns a new value to the string, replacing its current contents. More... | |
template<tSize T2, typename dT2 > | |
_myType & | assign (const stack_string_base< T2, dT2 > &strValue, tSize nPos, tSize nLength) |
Assigns a new value to the string, replacing its current contents. More... | |
_myType & | assign (const value_type *pChar, tSize nLength=InvalidPos) |
Assigns a new value to the string, replacing its current contents. More... | |
_myType & | assign (size_type nCount, value_type cCharacter) |
Assigns a new value to the string, replacing its current contents. More... | |
_myType & | assign (const value_type *strValue, tSize nPos, tSize nLength) |
Assigns a new value to the string, replacing its current contents. More... | |
const value_type & | operator[] (size_type nIdx) const |
Get character of string. More... | |
value_type & | operator[] (size_type nIdx) |
Get character of string. More... | |
template<tSize T2, typename dT2 > | |
_myType & | insert (tSize szInsertPos, const stack_string_base< T2, dT2 > &strValue, tSize szFromPos, tSize szLength) |
Insert into string. More... | |
_myType & | erase (size_type nPos, size_type szLength=InvalidPos) |
Erases the portion of the string value that begins at the character position nPos and spans szLength characters (or until the end of the string, if either the content is too short or if szLength is InvalidPos). More... | |
template<tSize T2, typename dT2 > | |
size_type | find (const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const |
Searches the string for the first occurrence of strValue. More... | |
_myType | substr (size_type nPos, size_type nLength=InvalidPos) const |
Returns a newly constructed string object with its value initialized to a copy of a substring of this object. More... | |
template<tSize T2, typename dT2 > | |
void | swap (stack_string_base< T2, dT2 > &strValue) |
Swap string values. More... | |
size_type | rfind (tChar cValue, size_type nStartPos=InvalidPos) const |
Searches the string for the last occurrence of a character. More... | |
template<tSize T2, typename dT2 > | |
size_type | find_first_of (const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const |
Searches the string for the first character that matches any of the characters in strValue. More... | |
template<tSize T2, typename dT2 > | |
size_type | find_first_not_of (const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const |
Searches the string for the first character that does not match any of the characters in strValue. More... | |
size_type | capacity () const |
Return size of allocated storage. | |
value_type * | data () |
Get string data. | |
const value_type * | cdata () const |
Get C string. | |
tVoid | resize (size_type szNewSize) |
Resize string. | |
![]() | |
stack_string_data () | |
Constructor. | |
stack_string_data (const stack_string_data &oStackData) | |
Constructor. | |
stack_string_data (stack_string_data &&oStackData) | |
Constructor. | |
virtual | ~stack_string_data () |
Destructor. | |
stack_string_data & | operator= (const stack_string_data &oStackData) |
String assignment. | |
stack_string_data & | operator= (stack_string_data &&oStackData) |
String assignment. | |
size_type | capacity () const |
Return size of allocated storage. | |
size_type | max_size () const |
Return maximum size of string. | |
tVoid | resize (size_type szNewSize) |
Resize string. | |
value_type * | data () |
Get string data. | |
const value_type * | cdata () const |
Get C string. | |
Static Public Attributes | |
static const tSize | InvalidPos = g_npos |
used to identicate out of range, invalidpos or default length | |
Stacked String.
Definition at line 303 of file stackstring.h.
|
inline |
Appends a copy of of the first nLength characters of strValue.
[in] | strValue | Another string object, whose value is appended. |
[in] | nLength | Length of the substring to be copied. A value of -1 indicates all characters until the end of strValue (default). |
Definition at line 569 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::append().
|
inline |
Appends a copy of a substring of strValue.
[in] | strValue | Another string object, whose value is appended. |
[in] | nPos | Position of the first character in strValue that is copied to the object as a substring. |
[in] | nLength | Length of the substring to be copied. A value of -1 indicates all characters until the end of strValue. |
Definition at line 529 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), stack_string_base< TSIZE, datastoreType >::capacity(), cStringUtil::Copy(), stack_string_base< TSIZE, datastoreType >::data(), stack_string_base< TSIZE, datastoreType >::InvalidPos, stack_string_base< TSIZE, datastoreType >::length(), and stack_string_base< TSIZE, datastoreType >::resize().
|
inline |
Appends szCount consecutive copies of character c.
[in] | szCount | Number of characters to copy. |
[in] | c | Character value. |
Definition at line 490 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::capacity(), stack_string_base< TSIZE, datastoreType >::data(), stack_string_base< TSIZE, datastoreType >::InvalidPos, stack_string_base< TSIZE, datastoreType >::length(), and stack_string_base< TSIZE, datastoreType >::resize().
Referenced by stack_string_base< TSIZE, datastoreType >::append().
|
inline |
Assigns a new value to the string, replacing its current contents.
Copies strValue.
[in] | strValue | Reference to the string that should be copied. |
Definition at line 583 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), and stack_string_base< TSIZE, datastoreType >::length().
Referenced by stack_string_base< TSIZE, datastoreType >::stack_string_base(), stack_string_base< TSIZE, datastoreType >::assign(), stack_string_base< TSIZE, datastoreType >::operator=(), stack_string_base< TSIZE, datastoreType >::substr(), and stack_string_base< TSIZE, datastoreType >::swap().
|
inline |
Assigns a new value to the string, replacing its current contents.
Copies the portion of strValue that begins at the character position nPos and spans nLength characters.
[in] | strValue | Reference to the string that should be copied. |
[in] | nPos | Character position to begin copying. |
[in] | nLength | Number of characters that should be copied. |
Definition at line 600 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign(), and stack_string_base< TSIZE, datastoreType >::c_str().
|
inline |
Assigns a new value to the string, replacing its current contents.
Copies the first nLength characters from the array of characters pointed by pChar.
[in] | pChar | Pointer to the character array to copy from. |
[in] | nLength | Number of characters to copy. A value of -1 indicates copying all (default). |
Definition at line 616 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign().
|
inline |
Assigns a new value to the string, replacing its current contents.
Copies the portion of strValue that begins at the character position nPos and spans nLength characters.
[in] | strValue | Reference to the string that should be copied. |
[in] | nPos | Character position to begin copying. |
[in] | nLength | Number of characters that should be copied. |
Definition at line 664 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::capacity(), stack_string_base< TSIZE, datastoreType >::clear(), cStringUtil::Copy(), stack_string_base< TSIZE, datastoreType >::data(), cStringUtil::GetLength(), stack_string_base< TSIZE, datastoreType >::InvalidPos, and stack_string_base< TSIZE, datastoreType >::resize().
|
inline |
Assigns a new value to the string, replacing its current contents.
Replaces the current value by nCount consecutive copies of cCharacter.
[in] | nCount | Number of characters to fill the string with. |
[in] | cCharacter | Character value used for the filling. |
Definition at line 630 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::capacity(), stack_string_base< TSIZE, datastoreType >::clear(), stack_string_base< TSIZE, datastoreType >::data(), cStringUtil::Repeat(), and stack_string_base< TSIZE, datastoreType >::resize().
|
inline |
Erases the portion of the string value that begins at the character position nPos and spans szLength characters (or until the end of the string, if either the content is too short or if szLength is InvalidPos).
[in] | nPos | Position to start deleting characters from. |
[in] | szLength | Number of characters to delete. A value of -1 indicates deleting all until end of string (default). |
Definition at line 798 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::data(), and cStringUtil::Delete().
|
inline |
Searches the string for the first occurrence of strValue.
When nStartPos is specified, the search only includes characters at or after position nStartPos, ignoring any possible occurrences that include characters before nStartPos.
[in] | strValue | String value to search for. |
[in] | nStartPos | Position to start the search at. Default value is 0 to start at the beginning. |
Definition at line 817 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), cStringUtil::FindFirstOfToken(), stack_string_base< TSIZE, datastoreType >::InvalidPos, cStringUtil::IsEqual(), and stack_string_base< TSIZE, datastoreType >::length().
|
inline |
Searches the string for the first character that does not match any of the characters in strValue.
[in] | strValue | Another string with the characters to search for. |
[in] | nStartPos | Character position to start the search at. A value of 0 indicates a start at the beginning of the string (default). |
Definition at line 951 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::FindFirstNotOfToken().
|
inline |
Searches the string for the first character that matches any of the characters in strValue.
[in] | strValue | Another string with the characters to search for. |
[in] | nStartPos | Character position to start the search at. A value of 0 indicates a start at the beginning of the string (default). |
Definition at line 935 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::FindFirstOfToken().
|
inline |
Insert into string.
Inserts a copy of a substring of strValue. The substring is the portion of strValue that begins at the character position szFromPos and spans szLength characters (or until the end of strValue, if either strValue is too short or if szLength is szFromPos).
[in] | szInsertPos | Position to insert substring at. |
[in] | strValue | Reference to the string that should be copied. |
[in] | szFromPos | Position in strValue to start copying from. |
[in] | szLength | Number of characters to copy from strValue. |
Definition at line 738 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::capacity(), stack_string_base< TSIZE, datastoreType >::data(), cStringUtil::GetLength(), stack_string_base< TSIZE, datastoreType >::InvalidPos, stack_string_base< TSIZE, datastoreType >::length(), cStringUtil::PushFront(), and stack_string_base< TSIZE, datastoreType >::resize().
|
inline |
Assignment operator.
[in] | strValue | Reference to the string that should be assigned. |
Definition at line 383 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign().
|
inline |
Assignment operator.
[in] | strValue | Reference to the string that should be assigned. |
Definition at line 405 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign().
|
inline |
Get character of string.
[in] | nIdx | Index of the character within the string. |
Definition at line 719 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::data().
|
inline |
Get character of string.
[in] | nIdx | Index of the character within the string. |
Definition at line 707 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::cdata().
|
inline |
Searches the string for the last occurrence of a character.
[in] | cValue | The character to search for. |
[in] | nStartPos | Character position to start the search at. A value of -1 indicates a start at the beginning of the string (default). |
Definition at line 916 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::RFindFirstOfToken().
|
inline |
Returns a newly constructed string object with its value initialized to a copy of a substring of this object.
[in] | nPos | Position of the first character to be copied as a substring. |
[in] | nLength | Number of characters to include in the substring. A value of -1 indicates all characters until the end of the string (default). |
Definition at line 870 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign(), stack_string_base< TSIZE, datastoreType >::cdata(), stack_string_base< TSIZE, datastoreType >::InvalidPos, and stack_string_base< TSIZE, datastoreType >::length().
|
inline |
Swap string values.
Exchanges the content of the container by the content of strValue, which is another string object. Lengths may differ.
[in] | strValue | Another string object, whose value is swapped with that of this string. |
Definition at line 898 of file stackstring.h.
References stack_string_base< TSIZE, datastoreType >::assign().