common::BstrString Class Reference
[BstrString Module]

Wrapper for Unicode string of type BSTR used in Windows OLE Automation. More...

#include <BstrString.hpp>

List of all members.

Public Member Functions

 BstrString ()
 BstrString (const BstrString &bstr)
 BstrString (const char *str)
 BstrString (const char *str, size_t strLen)
 BstrString (const wchar_t *wcs)
 BstrString (const wchar_t *wcs, size_t wcsLen)
 BstrString (const std::string &s)
 BstrString (const std::wstring &s)
 BstrString (BSTR bstr)
 Takes ownership of existing BSTR.
 BstrString (size_t length)
 Allocates, but doesn't initialize.
 ~BstrString ()
void assign (const BstrString &bstr)
void assign (const char *str)
void assign (const char *str, size_t strLen)
void assign (const wchar_t *wcs)
void assign (const wchar_t *wcs, size_t wcsLen)
void assign (const std::string &s)
void assign (const std::wstring &s)
void assign (BSTR bstr)
 Takes ownership of existing BSTR.
BstrString & operator= (const BstrString &bstr)
BstrString & operator= (const char *str)
BstrString & operator= (const wchar_t *wcs)
BstrString & operator= (BSTR bstr)
 Takes ownership of existing BSTR.
BstrString & operator= (const std::string &s)
BstrString & operator= (const std::wstring &s)
bool operator== (const BstrString &bstr) const
bool operator!= (const BstrString &bstr) const
bool operator< (const BstrString &bstr) const
bool operator> (const BstrString &bstr) const
bool operator<= (const BstrString &bstr) const
bool operator>= (const BstrString &bstr) const
wchar_t & operator[] (size_t index)
const wchar_t & operator[] (size_t index) const
void append (const BstrString &bstr)
void append (const char *str)
void append (const char *str, size_t strLen)
void append (const wchar_t *wcs)
void append (const wchar_t *wcs, size_t wcsLen)
void append (const std::string &s)
void append (const std::wstring &s)
void append (BSTR bstr)
BstrString & operator+= (const BstrString &bstr)
BstrString & operator+= (const char *str)
BstrString & operator+= (const wchar_t *wcs)
BstrString & operator+= (const std::string &s)
BstrString & operator+= (const std::wstring &s)
BstrString & operator+= (BSTR bstr)
BstrString operator+ (const BstrString &bstr) const
void clear ()
const char * c_str () const
const wchar_t * wc_str () const
BSTR data ()
BSTR b_str () const
size_t CalcStrLen () const
 Calculate buffer size necessary to convert the string to ANSI string. Result is without trailing zero.
bool ConvertToStr (char *outBuf, size_t bufLen) const
 Converts the string to ANSI string. Appends trailing zero if there is enought room for it.
size_t length () const
size_t size () const
bool empty () const
void resize (size_t newLength)
BstrString substr (size_t off=0, size_t count=0xFFFFFFFF) const

Static Public Member Functions

static int Cmp (const BstrString &bstr1, const BstrString &bstr2, bool ignoreCase=false)
 Returns number less, greater or equal to 0 according to comparison result.

Detailed Description

Wrapper for Unicode string of type BSTR used in Windows OLE Automation.

Automatically manages and frees memory of the string.
Interface is similar to std::string.
Also supports automatic conversion from and to ANSI string char* and std::string.


Constructor & Destructor Documentation

common::BstrString::BstrString (  ) 
common::BstrString::BstrString ( const BstrString &  bstr  ) 
common::BstrString::BstrString ( const char *  str  ) 
common::BstrString::BstrString ( const char *  str,
size_t  strLen 
)
common::BstrString::BstrString ( const wchar_t *  wcs  ) 
common::BstrString::BstrString ( const wchar_t *  wcs,
size_t  wcsLen 
)
common::BstrString::BstrString ( const std::string &  s  ) 
common::BstrString::BstrString ( const std::wstring &  s  ) 
common::BstrString::BstrString ( BSTR  bstr  ) 

Takes ownership of existing BSTR.

common::BstrString::BstrString ( size_t  length  ) 

Allocates, but doesn't initialize.

common::BstrString::~BstrString (  ) 

Member Function Documentation

void common::BstrString::append ( BSTR  bstr  ) 
void common::BstrString::append ( const std::wstring &  s  ) 
void common::BstrString::append ( const std::string &  s  ) 
void common::BstrString::append ( const wchar_t *  wcs,
size_t  wcsLen 
)
void common::BstrString::append ( const wchar_t *  wcs  ) 
void common::BstrString::append ( const char *  str,
size_t  strLen 
)
void common::BstrString::append ( const char *  str  ) 
void common::BstrString::append ( const BstrString &  bstr  ) 
void common::BstrString::assign ( BSTR  bstr  ) 

Takes ownership of existing BSTR.

void common::BstrString::assign ( const std::wstring &  s  ) 
void common::BstrString::assign ( const std::string &  s  ) 
void common::BstrString::assign ( const wchar_t *  wcs,
size_t  wcsLen 
)
void common::BstrString::assign ( const wchar_t *  wcs  ) 
void common::BstrString::assign ( const char *  str,
size_t  strLen 
)
void common::BstrString::assign ( const char *  str  ) 
void common::BstrString::assign ( const BstrString &  bstr  ) 
BSTR common::BstrString::b_str (  )  const [inline]
const char* common::BstrString::c_str (  )  const
size_t common::BstrString::CalcStrLen (  )  const

Calculate buffer size necessary to convert the string to ANSI string. Result is without trailing zero.

void common::BstrString::clear (  ) 
static int common::BstrString::Cmp ( const BstrString &  bstr1,
const BstrString &  bstr2,
bool  ignoreCase = false 
) [static]

Returns number less, greater or equal to 0 according to comparison result.

bool common::BstrString::ConvertToStr ( char *  outBuf,
size_t  bufLen 
) const

Converts the string to ANSI string. Appends trailing zero if there is enought room for it.

BSTR common::BstrString::data (  )  [inline]
bool common::BstrString::empty (  )  const [inline]
size_t common::BstrString::length (  )  const
bool common::BstrString::operator!= ( const BstrString &  bstr  )  const [inline]
BstrString common::BstrString::operator+ ( const BstrString &  bstr  )  const
BstrString& common::BstrString::operator+= ( BSTR  bstr  )  [inline]
BstrString& common::BstrString::operator+= ( const std::wstring &  s  )  [inline]
BstrString& common::BstrString::operator+= ( const std::string &  s  )  [inline]
BstrString& common::BstrString::operator+= ( const wchar_t *  wcs  )  [inline]
BstrString& common::BstrString::operator+= ( const char *  str  )  [inline]
BstrString& common::BstrString::operator+= ( const BstrString &  bstr  )  [inline]
bool common::BstrString::operator< ( const BstrString &  bstr  )  const [inline]
bool common::BstrString::operator<= ( const BstrString &  bstr  )  const [inline]
BstrString& common::BstrString::operator= ( const std::wstring &  s  )  [inline]
BstrString& common::BstrString::operator= ( const std::string &  s  )  [inline]
BstrString& common::BstrString::operator= ( BSTR  bstr  )  [inline]

Takes ownership of existing BSTR.

BstrString& common::BstrString::operator= ( const wchar_t *  wcs  )  [inline]
BstrString& common::BstrString::operator= ( const char *  str  )  [inline]
BstrString& common::BstrString::operator= ( const BstrString &  bstr  )  [inline]
bool common::BstrString::operator== ( const BstrString &  bstr  )  const [inline]
bool common::BstrString::operator> ( const BstrString &  bstr  )  const [inline]
bool common::BstrString::operator>= ( const BstrString &  bstr  )  const [inline]
const wchar_t& common::BstrString::operator[] ( size_t  index  )  const [inline]
wchar_t& common::BstrString::operator[] ( size_t  index  )  [inline]
void common::BstrString::resize ( size_t  newLength  ) 
size_t common::BstrString::size (  )  const [inline]
BstrString common::BstrString::substr ( size_t  off = 0,
size_t  count = 0xFFFFFFFF 
) const
const wchar_t* common::BstrString::wc_str (  )  const [inline]

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

Generated on Wed Dec 16 20:44:54 2009 for CommonLib by  doxygen 1.6.1