当前位置: 首页>>代码示例>>C++>>正文


C++ FormData::append方法代码示例

本文整理汇总了C++中FormData::append方法的典型用法代码示例。如果您正苦于以下问题:C++ FormData::append方法的具体用法?C++ FormData::append怎么用?C++ FormData::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormData的用法示例。


在下文中一共展示了FormData::append方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: appendToFormData

void HTMLTextAreaElement::appendToFormData(FormData& formData) {
  if (name().isEmpty())
    return;

  document().updateStyleAndLayout();

  const String& text =
      (m_wrap == HardWrap) ? valueWithHardLineBreaks() : value();
  formData.append(name(), text);

  const AtomicString& dirnameAttrValue = fastGetAttribute(dirnameAttr);
  if (!dirnameAttrValue.isNull())
    formData.append(dirnameAttrValue, directionForFormData());
}
开发者ID:mirror,项目名称:chromium,代码行数:14,代码来源:HTMLTextAreaElement.cpp

示例2:

TEST(FormDataTest, has) {
    FormData* fd = FormData::create(UTF8Encoding());
    fd->append("name1", "value1");

    EXPECT_TRUE(fd->has("name1"));
    EXPECT_EQ(1u, fd->size());
}
开发者ID:mirror,项目名称:chromium,代码行数:7,代码来源:FormDataTest.cpp

示例3: appendToFormData

void HiddenInputType::appendToFormData(FormData& formData) const
{
    if (equalIgnoringCase(element().name(), "_charset_")) {
        formData.append(element().name(), String(formData.encoding().name()));
        return;
    }
    InputType::appendToFormData(formData);
}
开发者ID:dstockwell,项目名称:blink,代码行数:8,代码来源:HiddenInputType.cpp

示例4: id

PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData(
    String& contentType) const {
  if (m_additionalData.isURLSearchParams()) {
    // If |additionalData| is a 'URLSearchParams' object, build a urlencoded
    // response.
    URLSearchParams* params = URLSearchParams::create(URLSearchParamsInit());
    URLSearchParams* additionalData = m_additionalData.getAsURLSearchParams();
    for (const auto& param : additionalData->params()) {
      const String& name = param.first;
      if (name != idName() && name != passwordName())
        params->append(name, param.second);
    }
    params->append(idName(), id());
    params->append(passwordName(), password());

    contentType =
        AtomicString("application/x-www-form-urlencoded;charset=UTF-8");

    return params->toEncodedFormData();
  }

  // Otherwise, we'll build a multipart response.
  FormData* formData = FormData::create(nullptr);
  if (m_additionalData.isFormData()) {
    FormData* additionalData = m_additionalData.getAsFormData();
    for (const FormData::Entry* entry : additionalData->entries()) {
      const String& name = formData->decode(entry->name());
      if (name == idName() || name == passwordName())
        continue;

      if (entry->blob())
        formData->append(name, entry->blob(), entry->filename());
      else
        formData->append(name, formData->decode(entry->value()));
    }
  }
  formData->append(idName(), id());
  formData->append(passwordName(), password());

  RefPtr<EncodedFormData> encodedData = formData->encodeMultiPartFormData();
  contentType = AtomicString("multipart/form-data; boundary=") +
                encodedData->boundary().data();
  return encodedData.release();
}
开发者ID:mirror,项目名称:chromium,代码行数:44,代码来源:PasswordCredential.cpp

示例5: appendToFormData

void HTMLObjectElement::appendToFormData(FormData& formData)
{
    if (name().isEmpty())
        return;

    Widget* widget = pluginWidget();
    if (!widget || !widget->isPluginView())
        return;
    String value;
    if (toPluginView(widget)->getFormValue(value))
        formData.append(name(), value);
}
开发者ID:dstockwell,项目名称:blink,代码行数:12,代码来源:HTMLObjectElement.cpp

示例6: appendToFormData

void HTMLKeygenElement::appendToFormData(FormData& formData) {
  // Only RSA is supported at this time.
  const AtomicString& keyType = fastGetAttribute(keytypeAttr);
  if (!keyType.isNull() && !equalIgnoringCase(keyType, "rsa"))
    return;
  SecurityOrigin* topOrigin =
      document().frame()->tree().top()->securityContext()->getSecurityOrigin();
  String value = Platform::current()->signedPublicKeyAndChallengeString(
      shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr),
      document().baseURL(), KURL(KURL(), topOrigin->toString()));
  if (!value.isNull())
    formData.append(name(), value);
}
开发者ID:mirror,项目名称:chromium,代码行数:13,代码来源:HTMLKeygenElement.cpp

示例7: appendToFormData

void SubmitInputType::appendToFormData(FormData& formData) const {
  if (element().isActivatedSubmit())
    formData.append(element().name(), element().valueOrDefaultLabel());
}
开发者ID:mirror,项目名称:chromium,代码行数:4,代码来源:SubmitInputType.cpp

示例8: appendToFormData

void InputType::appendToFormData(FormData& formData) const
{
    formData.append(element().name(), element().value());
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:4,代码来源:InputType.cpp

示例9: appendToFormData

void BaseCheckableInputType::appendToFormData(FormData& formData) const
{
    if (element().checked())
        formData.append(element().name(), element().value());
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:5,代码来源:BaseCheckableInputType.cpp


注:本文中的FormData::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。