Public Member Functions | Protected Attributes

BStr Struct Reference

#include <utility.h>

Collaboration diagram for BStr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BStr ()
 BStr (const BSTR s)
 BStr (LPCSTR s)
 BStr (LPCWSTR s)
 BStr (const VARIANT &var)
 ~BStr ()
void assign (BSTR s)
void assign (const VARIANT &var)
 operator BSTR () const
int length () const

Protected Attributes

BSTR _p

Detailed Description

Definition at line 727 of file utility.h.


Constructor & Destructor Documentation

BStr::BStr (  ) [inline]

Definition at line 729 of file utility.h.

    {
        _p = NULL;
    }
BStr::BStr ( const BSTR  s ) [inline]

Definition at line 734 of file utility.h.

    {
        _p = SysAllocString(s);
    }
BStr::BStr ( LPCSTR  s ) [inline]

Definition at line 739 of file utility.h.

References BUFFER_LEN.

    {
        WCHAR b[BUFFER_LEN];

        if (s)
            _p = SysAllocStringLen(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1);
        else
            _p = NULL;
    }
BStr::BStr ( LPCWSTR  s ) [inline]

Definition at line 749 of file utility.h.

    {
        _p = SysAllocString(s);
    }
BStr::BStr ( const VARIANT var ) [inline]

Definition at line 754 of file utility.h.

     :  _p(NULL)
    {
        assign(var);
    }
BStr::~BStr (  ) [inline]

Definition at line 760 of file utility.h.

    {
        SysFreeString(_p);
    }

Member Function Documentation

void BStr::assign ( BSTR  s )

Definition at line 101 of file webchild.cpp.

References _p, and THROW_EXCEPTION.

Referenced by assign().

{
    if (!SysReAllocString(&_p, s))
        THROW_EXCEPTION(E_OUTOFMEMORY);
}

Here is the caller graph for this function:

void BStr::assign ( const VARIANT var )

Definition at line 107 of file webchild.cpp.

References assign().

{
    if (V_VT(&var) == VT_BSTR)
        assign(V_BSTR(&var));
    else {
        Variant v;
        CheckError(VariantChangeType(&v, const_cast<VARIANT*>(&var), 0, VT_BSTR));
        assign(V_BSTR(&v));
    }
}

Here is the call graph for this function:

int BStr::length (  ) const [inline]

Definition at line 773 of file utility.h.

Referenced by String::assign().

    {
        return _p? wcslen(_p): 0;
    }

Here is the caller graph for this function:

BStr::operator BSTR (  ) const [inline]

Definition at line 768 of file utility.h.

    {
        return _p? _p: (BSTR)L"";
    }

Member Data Documentation

BSTR BStr::_p [protected]

Definition at line 779 of file utility.h.

Referenced by assign().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage