grab_cstring_buffer Class Reference
[String Library]

#include <mfcstl/string/grab_cstring_buffer.hpp>

List of all members.


Detailed Description

Scopes the aquisition and release of a CString buffer.

This class is used to scope the aquisition and release of a CString buffer ensuring that ReleaseBuffer() is called on the given CString object.

Public Member Functions

 grab_cstring_buffer (CString &str, int length) throw ( CMemoryException * )
 Acquires the requested length on the given managed string.
 ~grab_cstring_buffer () throw ()
 Releases the managed string.
LPCTSTR c_str () const
 Returns a pointer to a nul-terminated string.
 operator LPTSTR ()
 Provides mutating access to the managed string's internal buffer.
 operator LPCTSTR () const
 Provides non-mutating access to the managed string's internal buffer.
int length () const
 Returns the length of the managed string.
int original_length () const
 Returns the original length of the managed string.


Constructor & Destructor Documentation

grab_cstring_buffer ( CString &  str,
int  length 
) throw ( CMemoryException * ) [inline]

Acquires the requested length on the given managed string.

Calls GetBuffer(length) on the given string, after recording the original length. If acquisition fails then a CMemoryException is thrown.

~grab_cstring_buffer (  )  throw () [inline]

Releases the managed string.

References MFCSTL_MESSAGE_ASSERT.


Member Function Documentation

LPCTSTR c_str (  )  const [inline]

Returns a pointer to a nul-terminated string.

operator LPTSTR (  )  [inline]

Provides mutating access to the managed string's internal buffer.

operator LPCTSTR (  )  const [inline]

Provides non-mutating access to the managed string's internal buffer.

int length (  )  const [inline]

Returns the length of the managed string.

int original_length (  )  const [inline]

Returns the original length of the managed string.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:32 2010 for STLSoft by  doxygen 1.5.6