|
BDE 4.39.x Production Release
|
#include <bslstl_string.h>
This component private class implements a proctor that sets the length of a string to zero, and, if release is not called, will restore that string upon it's destruction. The intended usage is to implement assign methods in terms of append (by clearing the string before appending to it), while maintaining the strong exceptions guarantee.
s, the invariant s[s.length()] == CHAR_TYPE() is violated for non-empty s. This invariant will be restored by either a successful append or by the proctor's destructor if an exception is thrown. See bslstl_string
Public Member Functions | |
| String_ClearProctor (FULL_STRING_TYPE *stringPtr) | |
| ~String_ClearProctor () | |
| void | release () |
|
explicit |
Create a String_ClearProctor for the specified stringPtr, and set both the length of stringPtr to 0 and the first character of stringPtr to CHAR_TYPE().
| bsl::String_ClearProctor< FULL_STRING_TYPE >::~String_ClearProctor | ( | ) |
Destroy this object, and if release has not been called, restore the original state of the string supplied at construction.
| void bsl::String_ClearProctor< FULL_STRING_TYPE >::release | ( | ) |
Release the proctor indicating that the string state need not to be restored.