本文整理汇总了C++中StringView::characters16方法的典型用法代码示例。如果您正苦于以下问题:C++ StringView::characters16方法的具体用法?C++ StringView::characters16怎么用?C++ StringView::characters16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringView
的用法示例。
在下文中一共展示了StringView::characters16方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseImageCandidatesFromSrcsetAttribute
static void parseImageCandidatesFromSrcsetAttribute(StringView attribute, Vector<ImageCandidate>& imageCandidates)
{
// FIXME: We should consider replacing the direct pointers in the parsing process with StringView and positions.
if (attribute.is8Bit())
parseImageCandidatesFromSrcsetAttribute<LChar>(attribute.characters8(), attribute.length(), imageCandidates);
else
parseImageCandidatesFromSrcsetAttribute<UChar>(attribute.characters16(), attribute.length(), imageCandidates);
}
示例2: createIterator
UCharIterator createIterator(StringView string)
{
if (string.is8Bit())
return createLatin1Iterator(string.characters8(), string.length());
UCharIterator iterator;
uiter_setString(&iterator, string.characters16(), string.length());
return iterator;
}
示例3:
v8_inspector::StringView toV8InspectorStringView(const StringView& string) {
if (string.isNull())
return v8_inspector::StringView();
if (string.is8Bit())
return v8_inspector::StringView(
reinterpret_cast<const uint8_t*>(string.characters8()),
string.length());
return v8_inspector::StringView(
reinterpret_cast<const uint16_t*>(string.characters16()),
string.length());
}
示例4: setPattern
void TextSearcherICU::setPattern(const StringView& pattern,
bool caseSensitive) {
setCaseSensitivity(caseSensitive);
setPattern(pattern.characters16(), pattern.length());
}