Windows C++ Library
Public Member Functions | Private Member Functions | Private Attributes | Friends
WCL::ComStr Class Reference

An RAII class for managing COM strings, aka a BSTR. More...

#include <ComStr.hpp>

List of all members.

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 &)
ComStroperator= (const ComStr &)

Private Attributes

BSTR m_bstr

Friends

BSTR * AttachTo (ComStr &bstr)
 The underlying COM string.

Detailed Description

An RAII class for managing COM strings, aka a BSTR.


Constructor & Destructor Documentation

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]

Member Function Documentation

BSTR WCL::ComStr::Get ( ) const [inline]

Access the underlying value.

bool WCL::ComStr::Empty ( ) const [inline]

Query if we own a string.

Free the string.

void WCL::ComStr::Attach ( BSTR  bstr)

Take ownership of an external string.

Take external ownership of the string.

ComStr& WCL::ComStr::operator= ( const ComStr ) [private]

Friends And Related Function Documentation

BSTR* AttachTo ( ComStr bstr) [friend]

The underlying COM string.

Allow attachment via an output parameter.


Member Data Documentation

BSTR WCL::ComStr::m_bstr [private]

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