Function toString

Synopsis

#include <include/bitpropvariant.hpp>

wstring toString() const

Description

Return
the the value of this variant converted from any supported type to std::wstring.

Source

Lines 357-387 in src/bitpropvariant.cpp. Line 483 in include/bitpropvariant.hpp.

wstring BitPropVariant::toString() const {
    switch ( vt ) {
        case VT_BOOL:
            return boolVal ? L"true" : L"false";
        case VT_BSTR:
            return wstring( bstrVal, SysStringLen( bstrVal ) );
        case VT_UI1:
            return std::to_wstring( bVal );
        case VT_UI2:
            return std::to_wstring( uiVal );
        case VT_UINT:
            return std::to_wstring( uintVal );
        case VT_UI4:
            return std::to_wstring( ulVal );
        case VT_UI8:
            return std::to_wstring( uhVal.QuadPart );
        case VT_I1:
            return std::to_wstring( cVal );
        case VT_I2:
            return std::to_wstring( iVal );
        case VT_INT:
            return std::to_wstring( intVal );
        case VT_I4:
            return std::to_wstring( lVal );
        case VT_I8:
            return std::to_wstring( hVal.QuadPart );
        case VT_FILETIME:
            return std::to_wstring( filetime.dwHighDateTime ) + L", " + std::to_wstring( filetime.dwLowDateTime );
    }
    throw BitException( L"BitPropVariant type not supported (vt: " + std::to_wstring( vt ) + L")" );
}





Add Discussion as Guest

Log in