本文整理汇总了C++中SStringW::length方法的典型用法代码示例。如果您正苦于以下问题:C++ SStringW::length方法的具体用法?C++ SStringW::length怎么用?C++ SStringW::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SStringW
的用法示例。
在下文中一共展示了SStringW::length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _StringTranslate
SStringW cXMLLoader::_StringTranslate(SStringW strSource)
{
if (strSource.empty())
{
return L"";
}
uint32 Size = strSource.length() + 1;
swchar* pDest = new swchar[Size];
::gloMemSet(pDest, 0, sizeof(swchar) *Size);
const swchar* pSrc = strSource.c_str();
uint32 DestSeek = 0;
for (uint32 seek = 0; seek<Size; seek = seek + 1)
{
if (pSrc[seek] != L'&')
{
pDest[DestSeek] = pSrc[seek];
}
else
{
uint32 seek_begin = seek;
while ((seek<Size) && (pSrc[seek] != L';'))
{
seek = seek + 1;
}
if (seek == Size)
{
delete[] pDest;
pDest = nullptr;
return L"";
}
switch (seek - seek_begin - 1)
{
case 2:
if ((pSrc[seek_begin + 1] == L'l') && (pSrc[seek_begin + 2] == L't'))
{
pDest[DestSeek] = L'<';
}
if ((pSrc[seek_begin + 1] == L'g') && (pSrc[seek_begin + 2] == L't'))
{
pDest[DestSeek] = L'>';
}
break;
case 3:
if ((pSrc[seek_begin + 1] == L'a') && (pSrc[seek_begin + 2] == L'm') && (pSrc[seek_begin + 3] == L'p'))
{
pDest[DestSeek] = L'&';
}
break;
case 4:
if ((pSrc[seek_begin + 1] == L'a') && (pSrc[seek_begin + 2] == L'p') && (pSrc[seek_begin + 3] == L'o') && (pSrc[seek_begin + 4] == L's'))
{
pDest[DestSeek] = L'\'';
}
if ((pSrc[seek_begin + 1] == L'q') && (pSrc[seek_begin + 2] == L'u') && (pSrc[seek_begin + 3] == L'o') && (pSrc[seek_begin + 4] == L't'))
{
pDest[DestSeek] = L'=';
}
break;
default:
delete[] pDest;
pDest = nullptr;
return L"";
}
}
DestSeek = DestSeek + 1;
}
SStringW DestString = pDest;
delete[] pDest;
pDest = nullptr;
return DestString;
}