ADTF
|
forward declaration More...
Public Types | |
typedef string_list_base< storageT > | _myType |
definition of my type | |
typedef std::vector< storageT > | tStringList |
list of containing cStrings | |
typedef tStringList::const_iterator | const_iterator |
short typedefinition for cString lists iterators | |
typedef tStringList::const_reverse_iterator | const_reverse_iterator |
short typedefinition for cString lists reverse iterators | |
typedef tStringList::iterator | iterator |
short typedefinition for cString lists iterators | |
typedef tStringList::reverse_iterator | reverse_iterator |
short typedefinition for cString lists reverse iterators | |
Public Member Functions | |
iterator | begin () |
Return iterator to beginning. | |
iterator | end () |
Return iterator to end. | |
const_iterator | begin () const |
Return const_iterator to beginning. | |
const_iterator | end () const |
Return const_iterator to end. | |
const_iterator | cbegin () const |
Return iterator to beginning. | |
const_iterator | cend () const |
Return iterator to end. | |
reverse_iterator | rbegin () |
Return reverse iterator to reverse beginning. | |
reverse_iterator | rend () |
Return reverse iterator to reverse 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. | |
string_list_base () | |
Constructor that initializes an empty cStringList object. | |
string_list_base (const _myType &lstList) | |
Constructor that duplicates an existing string list. More... | |
string_list_base (_myType &&lstList) | |
Constructor that duplicates an existing string list. More... | |
string_list_base (const storageT &strList) | |
Constructor that creates string list from comma or semicolon-delimited string. More... | |
string_list_base (std::initializer_list< storageT > lstStrings) | |
string_list_base & | operator= (const _myType &lstList) |
The cStringList assignment (=) operator reinitializes existing string lists with an existing object. More... | |
string_list_base & | operator= (_myType &&lstList) |
The cStringList assignment (=) operator reinitializes existing string lists with an existing object. More... | |
virtual | ~string_list_base () |
Destructor. | |
tVoid | Copy (const _myType &lstList) |
This function copies the content of an existing string list to this cStringList object. More... | |
tVoid | Clear () |
This function cleans up the list and frees all allocated memory blocks. | |
tResult | Append (const storageT &strString) |
This function appends one string to the list. More... | |
tResult | Append (const _myType &lstString) |
This function appends the given list of strings to the list. More... | |
tResult | Add (const storageT &strString) |
This function appends one string to the list only if the strString is not yet part of the list. More... | |
tResult | Add (const _myType &lstString) |
This function appends strings of the given list to the list only if the string is not yet part of the list. More... | |
tResult | Insert (tSize nIdx, const storageT &strString) |
This function inserts a string to the list at a specified position. More... | |
tResult | Delete (tSize nIdx) |
This function removes one item from the list. More... | |
tVoid | Sort (tBool bIgnoreCase=tFalse) |
This function arranges the list elements. More... | |
tSize | GetItemCount () const |
This function returns the number of items the list contains. More... | |
const storageT & | Get (tSize nIdx, const storageT &strDefault="") const |
This function retrieves a string value from the list. More... | |
tResult | Set (tSize nIdx, const storageT &strValue) |
This function stores a string value into the list. More... | |
tSize | Find (const storageT &strString) const |
This function returns the position of a string inside the list. More... | |
tSize | Match (const storageT &strPattern) const |
Returns the index of the string matching a pattern. More... | |
tSize | FindNoCase (const storageT &strString) const |
This function returns the position of a string inside the list. More... | |
storageT | Join (const storageT &strSeparator) const |
This function concatenates all list elements to one single cString object. More... | |
tBool | IsEmpty () const |
This function checks if the string object is empty. More... | |
storageT & | operator[] (tSize nIdx) |
This function retrieves a string value from the list. More... | |
const storageT & | operator[] (tSize nIdx) const |
This function retrieves a string value from the list. More... | |
bool | operator== (const _myType &oList) const |
Static Public Member Functions | |
static tBool | fnSortLexically (const storageT &strFirst, const storageT &strSecond) |
Checks if two strings are sorted lexically. More... | |
Static Public Attributes | |
static const tSize | InvalidPos = g_npos |
used to identicate out of range, invalidpos or default length | |
Protected Attributes | |
tStringList | m_lstList |
Internally used string list. | |
forward declaration
String list class.
Definition at line 20 of file stringlist.h.
|
inline |
Constructor that duplicates an existing string list.
lstList | [in] List object to be copied. |
Definition at line 109 of file stringlist.h.
|
inline |
Constructor that duplicates an existing string list.
lstList | [in] List object to be copied. |
Definition at line 120 of file stringlist.h.
|
inline |
Constructor that creates string list from comma or semicolon-delimited string.
Both delimiters can be used at the same time.
strList | [in] Comma or semicolon-delimited string. |
Definition at line 133 of file stringlist.h.
References string_base< cStackString >::InvalidPos, and string_list_base< storageT >::m_lstList.
This function appends strings of the given list to the list only if the string is not yet part of the list.
lstString | [in] String to be added if strString is not already Part of the List |
ERR_NOERROR | at least one string was added. |
ERR_FAILED | no string of the list was added, every string is already part of the list |
Definition at line 339 of file stringlist.h.
References string_list_base< storageT >::begin(), string_list_base< storageT >::end(), IS_OK, RETURN_ERROR, and RETURN_NOERROR.
|
inline |
This function appends one string to the list only if the strString
is not yet part of the list.
strString | [in] String to be added if strString is not already Part of the List |
ERR_NOERROR | the string was added. |
ERR_FAILED | the string is not added, already part of the list |
Definition at line 317 of file stringlist.h.
References RETURN_ERROR, and RETURN_NOERROR.
This function appends the given list of strings to the list.
lstString | [in] Stringlist to append |
Definition at line 293 of file stringlist.h.
References string_list_base< storageT >::cbegin(), string_list_base< storageT >::cend(), and RETURN_NOERROR.
|
inline |
This function appends one string to the list.
strString | [in] String to be appended |
Definition at line 277 of file stringlist.h.
References RETURN_NOERROR.
Referenced by string_base< storageT >::Split(), and string_base< storageT >::SplitToken().
This function copies the content of an existing string list to this cStringList object.
lstList | [in] List object to be copied. |
Definition at line 248 of file stringlist.h.
References string_list_base< storageT >::m_lstList.
This function removes one item from the list.
nIdx | [in] Position where the string should be removed. The element currently at this position as well as all following elements are moved one position further back ( Position n -> Position n-1 ) |
Definition at line 397 of file stringlist.h.
References RETURN_ERROR.
|
inline |
This function returns the position of a string inside the list.
strString | [in] String to find inside the list. |
Definition at line 522 of file stringlist.h.
|
inline |
This function returns the position of a string inside the list.
strString | [in] String to find inside the list. |
Definition at line 620 of file stringlist.h.
|
inlinestatic |
Checks if two strings are sorted lexically.
[in] | strFirst | |
[in] | strSecond |
Definition at line 420 of file stringlist.h.
|
inline |
This function retrieves a string value from the list.
nIdx | [in] Zero-based list index of the element to be fetched. |
strDefault | [in] Default value that is returned if the element was not found (default is an empty string) or nIdx was negative. |
Definition at line 475 of file stringlist.h.
|
inline |
This function returns the number of items the list contains.
Definition at line 460 of file stringlist.h.
This function inserts a string to the list at a specified position.
nIdx | [in] Position where the string should be inserted to. If this is zero or below zero, the element is appended at the front of the list. If the value is greater than the number of elements in the list, the element is appended at the end. |
strString | [in] String to be inserted |
Definition at line 374 of file stringlist.h.
References RETURN_ERROR, and RETURN_NOERROR.
|
inline |
This function checks if the string object is empty.
Definition at line 678 of file stringlist.h.
|
inline |
This function concatenates all list elements to one single cString object.
The strings are separated by a separator string.
strSeparator | [in] Separator string. |
Definition at line 647 of file stringlist.h.
References tTrue.
|
inline |
Returns the index of the string matching a pattern.
strPattern | [in] The pattern to match (can contain the '*' wildcard at the beginning and at the end). |
Definition at line 541 of file stringlist.h.
References string_base< cStackString >::InvalidPos.
|
inline |
The cStringList assignment (=) operator reinitializes existing string lists with an existing object.
lstList | [in] List object to be copied. |
Definition at line 221 of file stringlist.h.
|
inline |
The cStringList assignment (=) operator reinitializes existing string lists with an existing object.
lstList | [in] List object to be copied. |
Definition at line 207 of file stringlist.h.
|
inline |
This function retrieves a string value from the list.
nIdx | [in] Zero-based list index of the element to be fetched. |
Definition at line 694 of file stringlist.h.
|
inline |
This function retrieves a string value from the list.
nIdx | [in] Zero-based list index of the element to be fetched. |
Definition at line 700 of file stringlist.h.
This function stores a string value into the list.
nIdx | [in] Zero-based list index of the element to be written to. If the provided index is bigger than the last existing index n, the element is appended at position n+1. If the value is negative, the operation fails. |
strValue | [in] Value that is written to the list. |
ERR_NOERROR | if everything was ok |
ERR_INVALID_ARG | if InvalidPos == nIdx |
Definition at line 496 of file stringlist.h.
References RETURN_NOERROR.
This function arranges the list elements.
bIgnoreCase | [in] If false, a strict character code comparison is performed. Otherwise the comparison is made case insensitive. The character code comparison is the default behavior. |
Definition at line 442 of file stringlist.h.