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);
}
UCharIterator createIterator(StringView string)
{
    if (string.is8Bit())
        return createLatin1Iterator(string.characters8(), string.length());
    UCharIterator iterator;
    uiter_setString(&iterator, string.characters16(), string.length());
    return iterator;
}
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());
}
Exemple #4
0
static CSSPrimitiveValue::UnitTypes stringToUnitType(StringView stringView)
{
    if (stringView.is8Bit())
        return cssPrimitiveValueUnitFromTrie(stringView.characters8(), stringView.length());
    return cssPrimitiveValueUnitFromTrie(stringView.characters16(), stringView.length());
}
Exemple #5
0
void TextSearcherICU::setPattern(const StringView& pattern,
                                 bool caseSensitive) {
  setCaseSensitivity(caseSensitive);
  setPattern(pattern.characters16(), pattern.length());
}