Windows C++ Library
|
An RAII class for managing COM strings, aka a BSTR. More...
#include <ComStr.hpp>
Public Member Functions | |
ComStr () | |
Default constructor. | |
ComStr (BSTR bstr) | |
Construction by taking ownership of an existing string. | |
ComStr (const char *psz) | |
Construction from an ANSI string. | |
ComStr (const wchar_t *psz) | |
Construction from a UNICODE string. | |
ComStr (const tstring &str) | |
Construction from a std string. | |
~ComStr () | |
Destructor. | |
BSTR | Get () const |
Access the underlying value. | |
bool | Empty () const |
Query if we own a string. | |
void | Release () |
Free the string. | |
void | Attach (BSTR bstr) |
Take ownership of an external string. | |
BSTR | Detach () |
Take external ownership of the string. | |
Private Member Functions | |
ComStr (const ComStr &) | |
ComStr & | operator= (const ComStr &) |
Private Attributes | |
BSTR | m_bstr |
Friends | |
BSTR * | AttachTo (ComStr &bstr) |
The underlying COM string. |
An RAII class for managing COM strings, aka a BSTR.
Default constructor.
WCL::ComStr::ComStr | ( | BSTR | bstr | ) | [explicit] |
Construction by taking ownership of an existing string.
WCL::ComStr::ComStr | ( | const char * | psz | ) | [explicit] |
Construction from an ANSI string.
WCL::ComStr::ComStr | ( | const wchar_t * | psz | ) | [explicit] |
Construction from a UNICODE string.
WCL::ComStr::ComStr | ( | const tstring & | str | ) | [explicit] |
Construction from a std string.
Destructor.
WCL::ComStr::ComStr | ( | const ComStr & | ) | [private] |
BSTR WCL::ComStr::Get | ( | ) | const [inline] |
Access the underlying value.
bool WCL::ComStr::Empty | ( | ) | const [inline] |
Query if we own a string.
void WCL::ComStr::Release | ( | ) |
Free the string.
void WCL::ComStr::Attach | ( | BSTR | bstr | ) |
Take ownership of an external string.
BSTR WCL::ComStr::Detach | ( | ) |
Take external ownership of the string.
The underlying COM string.
Allow attachment via an output parameter.
BSTR WCL::ComStr::m_bstr [private] |