本文整理汇总了C++中TextEncoding::name方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEncoding::name方法的具体用法?C++ TextEncoding::name怎么用?C++ TextEncoding::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEncoding
的用法示例。
在下文中一共展示了TextEncoding::name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: action
WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const WebInputElement& selectedInputElement)
{
RefPtr<HTMLFormElement> formElement = form.operator PassRefPtr<HTMLFormElement>();
const Frame* frame = formElement->document()->frame();
if (!frame)
return;
HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HTMLInputElement>().get();
// Only consider forms that GET data.
// Allow HTTPS only when an input element is provided.
if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post")
|| (!IsHTTPFormSubmit(formElement.get()) && !inputElement))
return;
Vector<char> encodedString;
TextEncoding encoding;
GetFormEncoding(formElement.get(), &encoding);
if (!encoding.isValid()) {
// Need a valid encoding to encode the form elements.
// If the encoding isn't found webkit ends up replacing the params with
// empty strings. So, we don't try to do anything here.
return;
}
// Look for a suitable search text field in the form when a
// selectedInputElement is not provided.
if (!inputElement) {
inputElement = findSuitableSearchInputElement(formElement.get());
// Return if no suitable text element has been found.
if (!inputElement)
return;
}
HTMLFormControlElement* firstSubmitButton = GetButtonToActivate(formElement.get());
if (firstSubmitButton) {
// The form does not have an active submit button, make the first button
// active. We need to do this, otherwise the URL will not contain the
// name of the submit button.
firstSubmitButton->setActivatedSubmit(true);
}
bool isValidSearchString = buildSearchString(formElement.get(), &encodedString, &encoding, inputElement);
if (firstSubmitButton)
firstSubmitButton->setActivatedSubmit(false);
// Return if the search string is not valid.
if (!isValidSearchString)
return;
String action(formElement->action());
KURL url(frame->loader()->completeURL(action.isNull() ? "" : action));
RefPtr<FormData> formData = FormData::create(encodedString);
url.setQuery(formData->flattenToString());
m_url = url;
m_encoding = String(encoding.name());
}
示例2: ASSERT
TextCodecBrew::TextCodecBrew(const TextEncoding& encoding)
: m_charsetConverter(0)
, m_encoding(encoding)
, m_numBufferedBytes(0)
{
String format = String::format("%s>%s", encoding.name(), m_internalEncodingName);
IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell;
AEECLSID classID = ISHELL_GetHandler(shell, AEEIID_ICharsetConv, format.latin1().data());
ISHELL_CreateInstance(shell, classID, reinterpret_cast<void**>(&m_charsetConverter));
ASSERT(m_charsetConverter);
}
示例3: setEncoding
void TextResourceDecoder::setEncoding(const TextEncoding& encoding, EncodingSource source)
{
// In case the encoding didn't exist, we keep the old one (helps some sites specifying invalid encodings).
if (!encoding.isValid())
return;
// When encoding comes from meta tag (i.e. it cannot be XML files sent via XHR),
// treat x-user-defined as windows-1252 (bug 18270)
if (source == EncodingFromMetaTag && strcasecmp(encoding.name(), "x-user-defined") == 0)
m_encoding = "windows-1252";
else if (source == EncodingFromMetaTag || source == EncodingFromXMLHeader || source == EncodingFromCSSCharset)
m_encoding = encoding.closestByteBasedEquivalent();
else
m_encoding = encoding;
m_codec.clear();
m_source = source;
}
开发者ID:johnwpoliver,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:18,代码来源:TextResourceDecoder.cpp
示例4: createICUConverter
void StreamingTextDecoderICU::createICUConverter()
{
TextEncoding encoding = m_encoding.effectiveEncoding();
const char* encodingName = encoding.name();
bool cachedEncodingEqual = cachedConverterEncoding == encoding.encodingID();
cachedConverterEncoding = InvalidEncoding;
if (cachedEncodingEqual && cachedConverterICU) {
m_converterICU = cachedConverterICU;
cachedConverterICU = 0;
} else {
UErrorCode err = U_ZERO_ERROR;
ASSERT(!m_converterICU);
m_converterICU = ucnv_open(encodingName, &err);
#if !LOG_DISABLED
if (err == U_AMBIGUOUS_ALIAS_WARNING)
LOG_ERROR("ICU ambiguous alias warning for encoding: %s", encodingName);
#endif
}
}
示例5: adoptPtr
static PassOwnPtr<TextCodec> newTextCodecWin(const TextEncoding& encoding, const void*)
{
return adoptPtr(new TextCodecWin(getCodePage(encoding.name())));
}
示例6: adoptPtr
PassOwnPtr<TextCodec> TextCodecICU::create(const TextEncoding& encoding, const void* additionalData)
{
// Name strings are persistently kept in TextEncodingRegistry maps, so they are never deleted.
return adoptPtr(new TextCodecICU(encoding.name(), static_cast<const char*>(additionalData)));
}