本文整理汇总了C++中com::Utf8Str::cloneTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Utf8Str::cloneTo方法的具体用法?C++ Utf8Str::cloneTo怎么用?C++ Utf8Str::cloneTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com::Utf8Str
的用法示例。
在下文中一共展示了Utf8Str::cloneTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogRel
HRESULT HostNetworkInterface::enableStaticIPConfigV6(const com::Utf8Str &aIPV6Address,
ULONG aIPV6NetworkMaskPrefixLength)
{
#ifndef VBOX_WITH_HOSTNETIF_API
return E_NOTIMPL;
#else
if (aIPV6NetworkMaskPrefixLength > 128)
return E_INVALIDARG;
int rc = S_OK;
if ( m.realIPV6Address != aIPV6Address
|| m.realIPV6PrefixLength != aIPV6NetworkMaskPrefixLength)
{
BSTR bstr;
aIPV6Address.cloneTo(&bstr);
if (aIPV6NetworkMaskPrefixLength == 0)
aIPV6NetworkMaskPrefixLength = 64;
rc = NetIfEnableStaticIpConfigV6(mVirtualBox, this, m.IPV6Address.raw(),
bstr, aIPV6NetworkMaskPrefixLength);
if (RT_FAILURE(rc))
{
LogRel(("Failed to EnableStaticIpConfigV6 with rc=%Rrc\n", rc));
return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;
}
else
{
m.realIPV6Address = aIPV6Address;
m.realIPV6PrefixLength = aIPV6NetworkMaskPrefixLength;
if (FAILED(mVirtualBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6Address",
mInterfaceName.raw()).raw(),
Bstr(aIPV6Address).raw())))
return E_FAIL;
if (FAILED(mVirtualBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6NetMask",
mInterfaceName.raw()).raw(),
BstrFmt("%u", aIPV6NetworkMaskPrefixLength).raw())))
return E_FAIL;
}
}
return S_OK;
#endif
}