comet::bstr_t Class Reference
[Com type wrappers., Com type wrappers.]
#include <comet/bstr.h>
Public Types | |
| typedef wchar_t | value_type |
| typedef std::wstring::iterator | iterator |
| typedef std::wstring::const_iterator | const_iterator |
| typedef std::wstring::reverse_iterator | reverse_iterator |
| typedef std::wstring::const_reverse_iterator | const_reverse_iterator |
| typedef std::wstring::size_type | size_type |
| typedef std::wstring::difference_type | difference_type |
| typedef wchar_t & | reference |
| typedef const wchar_t | const_reference |
Public Member Functions | |
| bstr_t () throw () | |
| bstr_t (const bstr_t &s) throw (std::bad_alloc) | |
| Copy constructor. | |
| bstr_t (const wchar_t *s) throw (std::bad_alloc) | |
| Construct string from const wchar_t*. | |
| bstr_t (const wchar_t *s, size_t len) throw (std::bad_alloc) | |
| bstr_t (const char *s) throw (std::runtime_error) | |
| Construct string from const char*. | |
| bstr_t (const char *s, size_t len) throw (std::bad_alloc) | |
| bstr_t (const std::string &s) throw (std::runtime_error) | |
| Construct string from const std::string&. | |
| bstr_t (const impl::auto_attach_t< BSTR > &s) throw () | |
| Construct string from BSTR. | |
| bstr_t (const std::wstring &s) throw (std::bad_alloc) | |
| Construct string from const std::wstring&. | |
| bstr_t (size_type sz, wchar_t c) throw (std::bad_alloc) | |
| bstr_t (size_type sz) throw (std::bad_alloc) | |
| template<typename IT> | bstr_t (IT first, IT last) |
| bstr_t (const uuid_t &u, bool braces=false) | |
| ~bstr_t () throw () | |
| Destructor. | |
| void | swap (bstr_t &x) throw () |
| Swap. | |
| const wchar_t * | c_str () const throw () |
| Explicit conversion to const wchar_t*. | |
| std::wstring | w_str () const throw () |
| Explicit conversion to std::wstring. | |
| std::string | s_str () const |
| Explicit conversion to std::string. | |
| std::string | t_str () const |
| Explicit conversion to "tstring". | |
| operator std::wstring () const | |
| Implicit conversion to std::wstring. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
| bool | is_null () const throw () |
| Returns true if and only if wrapped str is null. | |
| bool | is_empty () const throw () |
| bool | empty () const throw () |
| Returns true if and only if wrapped str has zero length. | |
| size_t | length () const throw () |
| Returns length of wrapped string. | |
| size_t | size () const throw () |
| BSTR | get_raw () const |
| int | cmp (const bstr_t &s, compare_flags_t flags=compare_flags_t(0)) const |
| String comparsion function. | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| reference | at (size_type i) |
| const_reference | at (size_type i) const |
| const_reference | operator[] (size_type idx) const |
| reference | operator[] (size_type idx) |
| void | assign (size_type sz, wchar_t c) throw (std::bad_alloc) |
Assign string to be sz of charater c . | |
| template<typename IT> void | assign (IT first, IT last) |
| Assign string from two iterators. | |
| template<typename T> bstr_t & | operator= (const T &x) |
| Assignment operator from any (non integer) constructable. | |
| bstr_t & | operator= (const bstr_t &x) throw (std::bad_alloc) |
| Default assignment. | |
| bstr_t | operator+ (const bstr_t &s) const throw (std::bad_alloc) |
| Concat operation. | |
| bstr_t | operator+ (const wchar_t *s) const throw (std::bad_alloc) |
| Concat with const wchar_t*. | |
| bstr_t | operator+ (const std::wstring &s) const throw (std::bad_alloc) |
| Concat with std::wstring. | |
| bstr_t & | operator+= (const bstr_t &s) throw (std::bad_alloc) |
| Concat assignment. | |
| bstr_t & | operator+= (const wchar_t *s) throw (std::bad_alloc) |
| Concat assigment with const wchar_t*. | |
| bstr_t & | operator+= (const std::wstring &s) throw (std::bad_alloc) |
| Concat assignment with std::wstring. | |
| BSTR * | get_ptr_to_raw () const |
| BSTR | in () const throw () |
| [in] adapter. | |
| BSTR * | in_ptr () const throw () |
| [in] adapter. | |
| BSTR * | out () throw () |
| [out] adapter. | |
| BSTR * | inout () throw (std::bad_alloc) |
| [in, out] adapter. | |
Boolean operators | |
| bool | operator== (const wchar_t *s) const |
| bool | operator!= (const wchar_t *s) const |
| bool | operator< (const wchar_t *s) const |
| bool | operator> (const wchar_t *s) const |
| bool | operator>= (const wchar_t *s) const |
| bool | operator<= (const wchar_t *s) const |
| bool | operator== (const std::wstring &s) const |
| bool | operator!= (const std::wstring &s) const |
| bool | operator< (const std::wstring &s) const |
| bool | operator> (const std::wstring &s) const |
| bool | operator>= (const std::wstring &s) const |
| bool | operator<= (const std::wstring &s) const |
| bool | operator== (const bstr_t &s) const |
| bool | operator!= (const bstr_t &s) const |
| bool | operator< (const bstr_t &s) const |
| bool | operator> (const bstr_t &s) const |
| bool | operator>= (const bstr_t &s) const |
| bool | operator<= (const bstr_t &s) const |
Static Public Member Functions | |
| BSTR | detach (bstr_t &s) |
| Detaches specified bstr. | |
| template<typename T> BSTR | detach (const T &s) |
Create a reference to a BSTR | |
| const bstr_t & | create_const_reference (const BSTR &s) throw () |
| bstr_t & | create_reference (BSTR &s) throw () |
Friends | |
| std::basic_ostream< char > & | operator<< (std::basic_ostream< char > &os, const bstr_t &val) |
| std::basic_ostream< wchar_t > & | operator<< (std::basic_ostream< wchar_t > &os, const bstr_t &val) |
| bstr_t | operator+ (const std::wstring &s, const bstr_t &t) throw (std::bad_alloc) |
| Concat operation. | |
| bstr_t | operator+ (const wchar_t *s, const bstr_t &t) throw (std::bad_alloc) |
| Concat operation. | |
Related Functions | |
| (Note that these are not member functions.) | |
Boolean Operators on String | |
| bool | operator== (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator!= (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator< (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator> (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator<= (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator>= (const wchar_t *s1, const bstr_t &s2) throw() |
| bool | operator== (const std::wstring &s1, const bstr_t &s2) throw() |
| bool | operator!= (const std::wstring &s1, const bstr_t &s2) throw() |
| bool | operator< (const std::wstring &s1, const bstr_t &s2) throw() |
| bool | operator> (const std::wstring &s1, const bstr_t &s2) throw() |
| bool | operator<= (const std::wstring &s1, const bstr_t &s2) throw() |
| bool | operator>= (const std::wstring &s1, const bstr_t &s2) throw() |
Detailed Description
BSTR Wrapper.- See also:
- bstr_t
Constructor & Destructor Documentation
|
|
Default constructor Constructs a null string. |
|
|
Copy constructor.
|
|
|
Construct string from const wchar_t*.
|
|
|
Construct string from const char*.
|
|
|
Construct string from const std::string&.
|
|
|
Construct string from BSTR. Takes ownership of specified BSTR. To prevent misuse the BSTR must be wrapped using auto_attach.
bstr_t bs( auto_attach( myBSTR ) );
|
|
|
Construct string from const std::wstring&.
|
|
|
Destructor. Deletes the wrapped BSTR. |
Member Function Documentation
|
||||||||||||
|
String comparsion function.
|
|
|
Creates a bstr_t that is a reference to the BSTR. It will not be reference counted and will not be deleted when the bstr_t goes out of scope. This is used by the interface wrappers for [in] BSTR's. Typically clients do not need create_reference. |
|
|
[in] adapter. Used when calling raw interfaces that require an [in] BSTR argument.
bstr_t bs; HRESULT hr = pRawInterface->raw_Method(bs.in()); Only use this wrapper when forced to deal with raw interface. |
|
|
[in] adapter. Used when calling raw interfaces that require an [in] BSTR* argument.
bstr_t bs; HRESULT hr = pRawInterface->raw_Method(bs.in_ptr()); Only use this wrapper when forced to deal with raw interface. |
|
|
[in, out] adapter. Used when calling raw interfaces that require an [in, out] BSTR * argument.
bstr_t bs; HRESULT hr = pRawInterface->raw_MethodThatChangesBSTR(bs.inout()); Only use this wrapper when forced to deal with raw interface.
|
|
|
Returns true if and only if wrapped str has zero length. |
|
|
[out] adapter. Used when calling raw interfaces that require an [out] BSTR * argument.
bstr_t bs; HRESULT hr = pRawInterface->raw_MethodThatReturnsBSTR(bs.out()); Only use this wrapper when forced to deal with raw interface. |
The documentation for this class was generated from the following file: