This is a simple utility class that can be used in situations where a AString is intermediately extended and later shortened back to its original length. With the use of this class, C++ stack-unwinding is used to ensure that the length is reset in all execution paths including exception handling, etc.
TChar | The character type of the AString that is to be reset. |
Definition at line 43 of file strings/fwds.hpp.
#include <astring.hpp>
Public Method Index: | |
TStringLengthResetter (TAString< TChar > &pAString) | |
~TStringLengthResetter () | |
integer | OriginalLength () |
void | ResetNow () |
|
protected |
The AString to reset.
Definition at line 2081 of file astring.hpp.
|
protected |
The The original length of the string.
Definition at line 2082 of file astring.hpp.
|
inline |
Constructor taking the string. Stores the current length in field originalLength.
pAString | The String to take the length of and reset on destruction. |
Definition at line 2103 of file astring.hpp.
|
inline |
Destructor. Restores the string's original length.
Definition at line 2109 of file astring.hpp.
|
private |
Private new to disallow heap allocation.
|
private |
Private new to disallow heap allocation.
|
private |
Private new to disallow heap allocation.
|
private |
Private new to disallow heap allocation.
|
private |
Private assignment operator.
|
inline |
Returns the original length.
Definition at line 2121 of file astring.hpp.
|
inline |
Resets the strings to the original length prior to destruction of this object.
Definition at line 2116 of file astring.hpp.