VirtualBox

Changeset 19239 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Apr 28, 2009 1:19:14 PM (16 years ago)
Author:
vboxsync
Message:

Main: support for using VBox from Python on Windows (still certain limitation apply, such as enum visibility)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/Guid.h

    r15959 r19239  
    7878    }
    7979
     80    Guid (const Bstr &that)
     81    {
     82        ::RTUuidClear (&uuid);
     83        if (!that.isNull())
     84           ::RTUuidFromUtf16(&uuid, that.raw());
     85    }
     86
    8087    Guid &operator= (const Guid &that)
    8188    {
     
    107114        ::RTUuidToStr (&uuid, buf, RTUUID_STR_LENGTH);
    108115        return Utf8Str (buf);
     116    }
     117
     118    Bstr toUtf16 () const
     119    {
     120        if (isEmpty())
     121          return Bstr();
     122
     123        RTUTF16 buf [RTUUID_STR_LENGTH];
     124        ::RTUuidToUtf16 (&uuid, buf, RTUUID_STR_LENGTH);
     125        return Bstr (buf);
    109126    }
    110127
     
    192209};
    193210
     211inline Bstr asGuidStr(const Bstr& str)
     212{
     213   Guid guid(str);
     214   return  guid.isEmpty() ? Bstr() : guid.toUtf16();
     215}
     216
     217inline bool isValidGuid(const Bstr& str)
     218{
     219   Guid guid(str);
     220   return  !guid.isEmpty();
     221}
     222
     223
    194224/* work around error C2593 of the stupid MSVC 7.x ambiguity resolver */
    195225WORKAROUND_MSVC7_ERROR_C2593_FOR_BOOL_OP (Guid)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette