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


C++ WebVector::assign方法代码示例

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


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

示例1: parse

// Old style parser. Deprecated.
static bool parse(const Dictionary& constraintsDictionary, WebVector<WebMediaConstraint>& optional, WebVector<WebMediaConstraint>& mandatory)
{
    if (constraintsDictionary.isUndefinedOrNull())
        return true;

    Vector<String> names;
    bool ok = constraintsDictionary.getPropertyNames(names);
    if (!ok)
        return false;

    String mandatoryName("mandatory");
    String optionalName("optional");

    for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) {
        if (*it != mandatoryName && *it != optionalName)
            return false;
    }

    if (names.contains(mandatoryName)) {
        Dictionary mandatoryConstraintsDictionary;
        bool ok = constraintsDictionary.get(mandatoryName, mandatoryConstraintsDictionary);
        if (!ok || mandatoryConstraintsDictionary.isUndefinedOrNull())
            return false;
        ok = parseMandatoryConstraintsDictionary(mandatoryConstraintsDictionary, mandatory);
        if (!ok)
            return false;
    }

    Vector<WebMediaConstraint> optionalConstraintsVector;
    if (names.contains(optionalName)) {
        ArrayValue optionalConstraints;
        bool ok = DictionaryHelper::get(constraintsDictionary, optionalName, optionalConstraints);
        if (!ok || optionalConstraints.isUndefinedOrNull())
            return false;

        size_t numberOfConstraints;
        ok = optionalConstraints.length(numberOfConstraints);
        if (!ok)
            return false;

        for (size_t i = 0; i < numberOfConstraints; ++i) {
            Dictionary constraint;
            ok = optionalConstraints.get(i, constraint);
            if (!ok || constraint.isUndefinedOrNull())
                return false;
            ok = parseOptionalConstraintsVectorElement(constraint, optionalConstraintsVector);
            if (!ok)
                return false;
        }
        optional.assign(optionalConstraintsVector);
    }

    return true;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:55,代码来源:MediaConstraintsImpl.cpp

示例2: getInputElements

void WebFormElement::getInputElements(WebVector<WebInputElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLInputElement> > tempVector;
    for (size_t i = 0; i < form->formElements.size(); i++) {
        if (form->formElements[i]->hasLocalName(HTMLNames::inputTag))
            tempVector.append(static_cast<HTMLInputElement*>(
                form->formElements[i]));
    }
    result.assign(tempVector);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:11,代码来源:WebFormElement.cpp

示例3: getFormControlElements

void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLFormControlElement> > formControlElements;

    const Vector<FormAssociatedElement*>& associatedElements = form->associatedElements();
    for (Vector<FormAssociatedElement*>::const_iterator it = associatedElements.begin(); it != associatedElements.end(); ++it) {
        if ((*it)->isFormControlElement())
            formControlElements.append(toHTMLFormControlElement(*it));
    }
    result.assign(formControlElements);
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:12,代码来源:WebFormElement.cpp

示例4: parseMandatoryConstraintsDictionary

static bool parseMandatoryConstraintsDictionary(const Dictionary& mandatoryConstraintsDictionary, WebVector<WebMediaConstraint>& mandatory)
{
    Vector<WebMediaConstraint> mandatoryConstraintsVector;
    HashMap<String, String> mandatoryConstraintsHashMap;
    bool ok = mandatoryConstraintsDictionary.getOwnPropertiesAsStringHashMap(mandatoryConstraintsHashMap);
    if (!ok)
        return false;

    for (const auto& iter : mandatoryConstraintsHashMap)
        mandatoryConstraintsVector.append(WebMediaConstraint(iter.key, iter.value));
    mandatory.assign(mandatoryConstraintsVector);
    return true;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:13,代码来源:MediaConstraintsImpl.cpp

示例5: images

void WebDocument::images(WebVector<WebElement>& results)
{
    RefPtr<HTMLCollection> images = unwrap<Document>()->images();
    size_t sourceLength = images->length();
    Vector<WebElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Node* node = images->item(i);
        if (node && node->isHTMLElement())
            temp.append(WebElement(static_cast<Element*>(node)));
    }
    results.assign(temp);
}
开发者ID:kseo,项目名称:webkit,代码行数:13,代码来源:WebDocument.cpp

示例6: images

void WebDocument::images(WebVector<WebElement>& results)
{
    RefPtr<HTMLCollection> images = unwrap<Document>()->images();
    size_t sourceLength = images->length();
    Vector<WebElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Element* element = images->item(i);
        if (element && element->isHTMLElement())
            temp.append(WebElement(element));
    }
    results.assign(temp);
}
开发者ID:pozdnyakov,项目名称:blink-crosswalk-1,代码行数:13,代码来源:WebDocument.cpp

示例7: getFormControlElements

void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLFormControlElement> > tempVector;
    // FIXME: We should move the for-loop condition into a variable instead of
    // re-evaluating size each time. Also, consider refactoring this code so that
    // we don't call form->associatedElements() multiple times.
    for (size_t i = 0; i < form->associatedElements().size(); i++) {
        if (form->associatedElements()[i]->hasLocalName(HTMLNames::inputTag)
            || form->associatedElements()[i]->hasLocalName(HTMLNames::selectTag))
            tempVector.append(form->associatedElements()[i]);
    }
    result.assign(tempVector);
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:14,代码来源:WebFormElement.cpp

示例8: forms

void WebDocument::forms(WebVector<WebFormElement>& results) const
{
    RefPtr<HTMLCollection> forms = const_cast<Document*>(constUnwrap<Document>())->forms();
    size_t sourceLength = forms->length();
    Vector<WebFormElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Node* node = forms->item(i);
        // Strange but true, sometimes node can be 0.
        if (node && node->isHTMLElement())
            temp.append(WebFormElement(static_cast<HTMLFormElement*>(node)));
    }
    results.assign(temp);
}
开发者ID:kseo,项目名称:webkit,代码行数:14,代码来源:WebDocument.cpp

示例9: forms

void WebDocument::forms(WebVector<WebFormElement>& results) const {
  HTMLCollection* forms =
      const_cast<Document*>(constUnwrap<Document>())->forms();
  size_t sourceLength = forms->length();
  Vector<WebFormElement> temp;
  temp.reserveCapacity(sourceLength);
  for (size_t i = 0; i < sourceLength; ++i) {
    Element* element = forms->item(i);
    // Strange but true, sometimes node can be 0.
    if (element && element->isHTMLElement())
      temp.append(WebFormElement(toHTMLFormElement(element)));
  }
  results.assign(temp);
}
开发者ID:mirror,项目名称:chromium,代码行数:14,代码来源:WebDocument.cpp

示例10: redirectChain

void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const
{
    result.assign(m_redirectChain);
}
开发者ID:rzr,项目名称:Tizen_Crosswalk,代码行数:4,代码来源:WebDataSourceImpl.cpp


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