ADTF  3.18.2
stack_string_base< TSIZE, datastoreType >

Stacked String. More...

Inheritance diagram for stack_string_base< TSIZE, datastoreType >:
[legend]

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_typeiterator
 short typedefinition for string iterators
 
typedef simple_pointer_iterator< const value_typeconst_iterator
 short typedefinition for string const_iterators
 
typedef std::reverse_iterator< iteratorreverse_iterator
 short typedefinition for string reverse iterators
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 short typedefinition for string reverse const_iterators
 
- Public Types inherited from stack_string_data< TSIZE, assert_out_of_range >
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_baseoperator= (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_baseoperator= (const stack_string_base< T2, dT2 > &strValue)
 String assignement.
 
 stack_string_base (_myType &&strValue)
 Constructor.
 
stack_string_baseoperator= (_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_baseoperator= (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_typec_str () const
 Get C string.
 
size_type length () const
 Return length of string.
 
tVoid clear ()
 Clear string content.
 
_myTypeappend (size_type szCount, value_type c)
 Appends szCount consecutive copies of character c. More...
 
template<tSize T2, typename dT2 >
_myTypeappend (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 >
_myTypeappend (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 >
_myTypeassign (const stack_string_base< T2, dT2 > &strValue)
 Assigns a new value to the string, replacing its current contents. More...
 
template<tSize T2, typename dT2 >
_myTypeassign (const stack_string_base< T2, dT2 > &strValue, tSize nPos, tSize nLength)
 Assigns a new value to the string, replacing its current contents. More...
 
_myTypeassign (const value_type *pChar, tSize nLength=InvalidPos)
 Assigns a new value to the string, replacing its current contents. More...
 
_myTypeassign (size_type nCount, value_type cCharacter)
 Assigns a new value to the string, replacing its current contents. More...
 
_myTypeassign (const value_type *strValue, tSize nPos, tSize nLength)
 Assigns a new value to the string, replacing its current contents. More...
 
const value_typeoperator[] (size_type nIdx) const
 Get character of string. More...
 
value_typeoperator[] (size_type nIdx)
 Get character of string. More...
 
template<tSize T2, typename dT2 >
_myTypeinsert (tSize szInsertPos, const stack_string_base< T2, dT2 > &strValue, tSize szFromPos, tSize szLength)
 Insert into string. More...
 
_myTypeerase (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_typedata ()
 Get string data.
 
const value_typecdata () const
 Get C string.
 
tVoid resize (size_type szNewSize)
 Resize string.
 
- Public Member Functions inherited from stack_string_data< TSIZE, assert_out_of_range >
 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_dataoperator= (const stack_string_data &oStackData)
 String assignment.
 
stack_string_dataoperator= (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_typedata ()
 Get string data.
 
const value_typecdata () const
 Get C string.
 

Static Public Attributes

static const tSize InvalidPos = g_npos
 used to identicate out of range, invalidpos or default length
 

Detailed Description

template<tSize TSIZE, typename datastoreType = assert_out_of_range>
class A_UTILS_NS::stack_string_base< TSIZE, datastoreType >

Stacked String.

Definition at line 303 of file stackstring.h.

Member Function Documentation

◆ append() [1/3]

_myType& append ( const stack_string_base< T2, dT2 > &  strValue,
size_type  nLength = InvalidPos 
)
inline

Appends a copy of of the first nLength characters of strValue.

Parameters
[in]strValueAnother string object, whose value is appended.
[in]nLengthLength of the substring to be copied. A value of -1 indicates all characters until the end of strValue (default).
Returns
Return reference to the string.

Definition at line 569 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::append().

◆ append() [2/3]

_myType& append ( const stack_string_base< T2, dT2 > &  strValue,
size_type  nPos,
size_type  nLength 
)
inline

Appends a copy of a substring of strValue.

Parameters
[in]strValueAnother string object, whose value is appended.
[in]nPosPosition of the first character in strValue that is copied to the object as a substring.
[in]nLengthLength of the substring to be copied. A value of -1 indicates all characters until the end of strValue.
Returns
Return reference to the string.

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().

◆ append() [3/3]

_myType& append ( size_type  szCount,
value_type  c 
)
inline

Appends szCount consecutive copies of character c.

Parameters
[in]szCountNumber of characters to copy.
[in]cCharacter value.
Returns
Return reference to the string.

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().

◆ assign() [1/5]

_myType& assign ( const stack_string_base< T2, dT2 > &  strValue)
inline

Assigns a new value to the string, replacing its current contents.

Copies strValue.

Parameters
[in]strValueReference to the string that should be copied.
Returns
Reference to the newly assigned string.

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().

◆ assign() [2/5]

_myType& assign ( const stack_string_base< T2, dT2 > &  strValue,
tSize  nPos,
tSize  nLength 
)
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.

Parameters
[in]strValueReference to the string that should be copied.
[in]nPosCharacter position to begin copying.
[in]nLengthNumber of characters that should be copied.
Returns
Reference to the newly assigned string.

Definition at line 600 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::assign(), and stack_string_base< TSIZE, datastoreType >::c_str().

◆ assign() [3/5]

_myType& assign ( const value_type pChar,
tSize  nLength = InvalidPos 
)
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.

Parameters
[in]pCharPointer to the character array to copy from.
[in]nLengthNumber of characters to copy. A value of -1 indicates copying all (default).
Returns
Reference to the newly assigned string.

Definition at line 616 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::assign().

◆ assign() [4/5]

_myType& assign ( const value_type strValue,
tSize  nPos,
tSize  nLength 
)
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.

Parameters
[in]strValueReference to the string that should be copied.
[in]nPosCharacter position to begin copying.
[in]nLengthNumber of characters that should be copied.
Returns
Reference to the newly assigned string.

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().

◆ assign() [5/5]

_myType& assign ( size_type  nCount,
value_type  cCharacter 
)
inline

Assigns a new value to the string, replacing its current contents.

Replaces the current value by nCount consecutive copies of cCharacter.

Parameters
[in]nCountNumber of characters to fill the string with.
[in]cCharacterCharacter value used for the filling.
Returns
Reference to the newly assigned string.

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().

◆ erase()

_myType& erase ( size_type  nPos,
size_type  szLength = InvalidPos 
)
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).

Parameters
[in]nPosPosition to start deleting characters from.
[in]szLengthNumber of characters to delete. A value of -1 indicates deleting all until end of string (default).
Returns
Reference to the string.

Definition at line 798 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::data(), and cStringUtil::Delete().

◆ find()

size_type find ( const stack_string_base< T2, dT2 > &  strValue,
size_type  nStartPos = 0 
) const
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.

Parameters
[in]strValueString value to search for.
[in]nStartPosPosition to start the search at. Default value is 0 to start at the beginning.
Returns
Return the position of the first character of the first match. If no matches were found, the function returns InvalidPos.

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().

◆ find_first_not_of()

size_type find_first_not_of ( const stack_string_base< T2, dT2 > &  strValue,
size_type  nStartPos = 0 
) const
inline

Searches the string for the first character that does not match any of the characters in strValue.

Parameters
[in]strValueAnother string with the characters to search for.
[in]nStartPosCharacter position to start the search at. A value of 0 indicates a start at the beginning of the string (default).
Returns
Return The position of the first character that does not match or InvalidPos if no such characters are found.

Definition at line 951 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::FindFirstNotOfToken().

◆ find_first_of()

size_type find_first_of ( const stack_string_base< T2, dT2 > &  strValue,
size_type  nStartPos = 0 
) const
inline

Searches the string for the first character that matches any of the characters in strValue.

Parameters
[in]strValueAnother string with the characters to search for.
[in]nStartPosCharacter position to start the search at. A value of 0 indicates a start at the beginning of the string (default).
Returns
Return The position of the first character that matches or InvalidPos if no matches were found.

Definition at line 935 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::FindFirstOfToken().

◆ insert()

_myType& insert ( tSize  szInsertPos,
const stack_string_base< T2, dT2 > &  strValue,
tSize  szFromPos,
tSize  szLength 
)
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).

Parameters
[in]szInsertPosPosition to insert substring at.
[in]strValueReference to the string that should be copied.
[in]szFromPosPosition in strValue to start copying from.
[in]szLengthNumber of characters to copy from strValue.
Returns
Reference to the string.

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().

◆ operator=() [1/2]

stack_string_base& operator= ( _myType &&  strValue)
inline

Assignment operator.

Parameters
[in]strValueReference to the string that should be assigned.
Returns
Reference to the newly assigned string.

Definition at line 383 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::assign().

◆ operator=() [2/2]

stack_string_base& operator= ( stack_string_base< T2, dT2 > &&  strValue)
inline

Assignment operator.

Parameters
[in]strValueReference to the string that should be assigned.
Returns
Reference to the newly assigned string.

Definition at line 405 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::assign().

◆ operator[]() [1/2]

value_type& operator[] ( size_type  nIdx)
inline

Get character of string.

Parameters
[in]nIdxIndex of the character within the string.
Returns
Returns a reference to the character at position nIdx in the string.

Definition at line 719 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::data().

◆ operator[]() [2/2]

const value_type& operator[] ( size_type  nIdx) const
inline

Get character of string.

Parameters
[in]nIdxIndex of the character within the string.
Returns
Returns a reference to the character at position nIdx in the string.

Definition at line 707 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::cdata().

◆ rfind()

size_type rfind ( tChar  cValue,
size_type  nStartPos = InvalidPos 
) const
inline

Searches the string for the last occurrence of a character.

Parameters
[in]cValueThe character to search for.
[in]nStartPosCharacter position to start the search at. A value of -1 indicates a start at the beginning of the string (default).
Returns
Return the position of the first character of the last match or InvalidPos if no matches were found.

Definition at line 916 of file stackstring.h.

References stack_string_base< TSIZE, datastoreType >::c_str(), and cStringUtil::RFindFirstOfToken().

◆ substr()

_myType substr ( size_type  nPos,
size_type  nLength = InvalidPos 
) const
inline

Returns a newly constructed string object with its value initialized to a copy of a substring of this object.

Parameters
[in]nPosPosition of the first character to be copied as a substring.
[in]nLengthNumber of characters to include in the substring. A value of -1 indicates all characters until the end of the string (default).
Returns
Return a string object with a substring of this object.

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().

◆ swap()

void swap ( stack_string_base< T2, dT2 > &  strValue)
inline

Swap string values.

Exchanges the content of the container by the content of strValue, which is another string object. Lengths may differ.

Parameters
[in]strValueAnother 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().