void SVGPreserveAspectRatio::parse(const String& string) { if (string.isEmpty()) { const LChar* ptr = 0; parseInternal(ptr, ptr, true); } else if (string.is8Bit()) { const LChar* ptr = string.characters8(); const LChar* end = ptr + string.length(); parseInternal(ptr, end, true); } else { const UChar* ptr = string.characters16(); const UChar* end = ptr + string.length(); parseInternal(ptr, end, true); } }
SVGParsingError SVGLengthList::setValueAsString(const String& value) { clear(); if (value.isEmpty()) return SVGParseStatus::NoError; if (value.is8Bit()) { const LChar* ptr = value.characters8(); const LChar* end = ptr + value.length(); return parseInternal(ptr, end); } const UChar* ptr = value.characters16(); const UChar* end = ptr + value.length(); return parseInternal(ptr, end); }
void SVGStringList::setValueAsString(const String& data, ExceptionState&) { // FIXME: Add more error checking and reporting. m_values.clear(); if (data.isEmpty()) return; if (data.is8Bit()) { const LChar* ptr = data.characters8(); const LChar* end = ptr + data.length(); parseInternal(ptr, end); } else { const UChar* ptr = data.characters16(); const UChar* end = ptr + data.length(); parseInternal(ptr, end); } }
void UpdateListFetcher::onDataAvailable() { m_netLock.lock(); const QByteArray &data = m_netReply->readAll(); RetCode tRet; if (m_netReply->error() != QNetworkReply::NoError) { tRet = RetCode::E_NETWORK_ERROR; goto out; } m_updateInfoList.clear(); m_xmlReader->addData(data); m_parseState = ParseState::AT_START; try { tRet = parseInternal(); } catch (InvalidDocumentStructureException &ex) { tRet = RetCode::E_INVALID_FILE_STRUCTURE; } catch (DuplicitInformationException &ex) { tRet = RetCode::E_INVALID_DATA; } out: m_netReply->deleteLater(); m_xmlReader->clear(); m_netLock.unlock(); emit listFetched(tRet, m_updateInfoList); }
void SVGLengthList::setValueAsString(const String& value, ExceptionState& exceptionState) { if (value.isEmpty()) { clear(); return; } if (value.is8Bit()) { const LChar* ptr = value.characters8(); const LChar* end = ptr + value.length(); parseInternal(ptr, end, exceptionState); } else { const UChar* ptr = value.characters16(); const UChar* end = ptr + value.length(); parseInternal(ptr, end, exceptionState); } }
void SVGPreserveAspectRatio::setValueAsString(const String& string, ExceptionState& exceptionState) { setDefault(); if (string.isEmpty()) return; bool valid = false; if (string.is8Bit()) { const LChar* ptr = string.characters8(); const LChar* end = ptr + string.length(); valid = parseInternal(ptr, end, true); } else { const UChar* ptr = string.characters16(); const UChar* end = ptr + string.length(); valid = parseInternal(ptr, end, true); } if (!valid) { exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid."); } }
bool SVGTransformList::parse(const LChar*& ptr, const LChar* end) { return parseInternal(ptr, end); }
bool SVGPreserveAspectRatio::parse(const UChar*& ptr, const UChar* end, bool validate) { return parseInternal(ptr, end, validate); }
bool SVGPreserveAspectRatio::parse(const UChar*& currParam, const UChar* end, bool validate) { return parseInternal(currParam, end, validate); }
void SVGPreserveAspectRatio::parse(const String& value) { auto upconvertedCharacters = StringView(value).upconvertedCharacters(); const UChar* begin = upconvertedCharacters; parseInternal(begin, begin + value.length(), true); }