Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

Bstr& com::Bstr::alloc ( size_t  aSize  )  [inline]

Allocates memory for a string capable to store aSize - 1 characters plus the terminating zero character. If aSize is zero, or if a memory allocation error occurs, this object will become null.

Definition at line 121 of file string.h.

References Assert, NULL, and SysAllocStringLen().

Referenced by Bstr().

        if (aSize)
            unsigned int size = (unsigned int) aSize; Assert (size == aSize);
            bstr = ::SysAllocStringLen (NULL, size - 1);
            if (bstr)
                bstr [0] = 0;
        return *this;

Generated by  Doxygen 1.6.0   Back to index