您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ toNode函数代码示例

51自学网 2021-06-03 08:53:08
  C++
这篇教程C++ toNode函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中toNode函数的典型用法代码示例。如果您正苦于以下问题:C++ toNode函数的具体用法?C++ toNode怎么用?C++ toNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: toNode

JSValue JSNode::replaceChild(ExecState* exec){    Node* imp = static_cast<Node*>(impl());    ExceptionCode ec = 0;    bool ok = imp->replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, true);    setDOMException(exec, ec);    if (ok)        return exec->argument(1);    return jsNull();}
开发者ID:Treeeater,项目名称:Chromium_on_windows,代码行数:10,


示例2: jsXPathEvaluatorPrototypeFunctionEvaluate

JSValue* jsXPathEvaluatorPrototypeFunctionEvaluate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSXPathEvaluator::s_info))        return throwError(exec, TypeError);    JSXPathEvaluator* castedThisObj = static_cast<JSXPathEvaluator*>(thisValue);    XPathEvaluator* imp = static_cast<XPathEvaluator*>(castedThisObj->impl());    ExceptionCode ec = 0;    const UString& expression = args[0]->toString(exec);    Node* contextNode = toNode(args[1]);    RefPtr<XPathNSResolver> customResolver;    XPathNSResolver* resolver = toXPathNSResolver(args[2]);    if (!resolver) {        customResolver = JSCustomXPathNSResolver::create(exec, args[2]);        if (exec->hadException())            return jsUndefined();        resolver = customResolver.get();    }    unsigned short type = args[3]->toInt32(exec);    XPathResult* inResult = toXPathResult(args[4]);    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->evaluate(expression, contextNode, resolver, type, inResult, ec)));    setDOMException(exec, ec);    return result;}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:25,


示例3: jsUndefined

JSValue JSCommandLineAPIHost::getEventListeners(ExecState* exec){    if (exec->argumentCount() < 1)        return jsUndefined();    JSValue value = exec->uncheckedArgument(0);    if (!value.isObject() || value.isNull())        return jsUndefined();    Node* node = toNode(value);    if (!node)        return jsUndefined();    Vector<EventListenerInfo> listenersArray;    impl().getEventListenersImpl(node, listenersArray);    JSObject* result = constructEmptyObject(exec);    for (size_t i = 0; i < listenersArray.size(); ++i) {        JSArray* listeners = getJSListenerFunctions(exec, &node->document(), listenersArray[i]);        if (!listeners->length())            continue;        AtomicString eventType = listenersArray[i].eventType;        result->putDirect(exec->vm(), Identifier(exec, eventType.impl()), JSValue(listeners));    }    return result;}
开发者ID:CannedFish,项目名称:webkit,代码行数:27,


示例4: jsUndefined

JSValue JSInjectedScriptHost::getEventListeners(ExecState* exec){    if (exec->argumentCount() < 1)        return jsUndefined();    JSValue value = exec->argument(0);    if (!value.isObject() || value.isNull())        return jsUndefined();    Node* node = toNode(value);    if (!node)        return jsUndefined();    // This can only happen for orphan DocumentType nodes.    Document* document = node->document();    if (!node->document())        return jsUndefined();    Vector<EventListenerInfo> listenersArray;    impl()->getEventListenersImpl(node, listenersArray);    JSObject* result = constructEmptyObject(exec);    for (size_t i = 0; i < listenersArray.size(); ++i) {        JSArray* listeners = getJSListenerFunctions(exec, document, listenersArray[i]);        if (!listeners->length())            continue;        AtomicString eventType = listenersArray[i].eventType;        result->putDirect(exec->globalData(), Identifier(exec, eventType.impl()), JSValue(listeners));    }    return result;}
开发者ID:dzhshf,项目名称:WebKit,代码行数:29,


示例5: jsUndefined

JSValue JSInspectorFrontendHost::search(ExecState* exec, const ArgList& args){    if (args.size() < 2)        return jsUndefined();    Node* node = toNode(args.at(0));    if (!node)        return jsUndefined();    String target = args.at(1).toString(exec);    if (exec->hadException())        return jsUndefined();    MarkedArgumentBuffer result;    RefPtr<Range> searchRange(rangeOfContents(node));    ExceptionCode ec = 0;    do {        RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));        if (resultRange->collapsed(ec))            break;        // A non-collapsed result range can in some funky whitespace cases still not        // advance the range's start position (4509328). Break to avoid infinite loop.        VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);        if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))            break;        result.append(toJS(exec, resultRange.get()));        setStart(searchRange.get(), newStart);    } while (true);    return constructArray(exec, result);}
开发者ID:flying-dutchmen,项目名称:3DS_w3Browser,代码行数:35,


示例6: jsXPathEvaluatorPrototypeFunctionEvaluate

EncodedJSValue JSC_HOST_CALL jsXPathEvaluatorPrototypeFunctionEvaluate(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSXPathEvaluator::s_info))        return throwVMTypeError(exec);    JSXPathEvaluator* castedThis = static_cast<JSXPathEvaluator*>(asObject(thisValue));    XPathEvaluator* imp = static_cast<XPathEvaluator*>(castedThis->impl());    ExceptionCode ec = 0;    const String& expression(ustringToString(exec->argument(0).toString(exec)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    Node* contextNode(toNode(exec->argument(1)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    RefPtr<XPathNSResolver> customResolver;    XPathNSResolver* resolver = toXPathNSResolver(exec->argument(2));    if (!resolver) {        customResolver = JSCustomXPathNSResolver::create(exec, exec->argument(2));        if (exec->hadException())            return JSValue::encode(jsUndefined());        resolver = customResolver.get();    }    unsigned short type(exec->argument(3).toUInt32(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    XPathResult* inResult(toXPathResult(exec->argument(4)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->evaluate(expression, contextNode, resolver, type, inResult, ec)));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:13W,项目名称:phantomjs,代码行数:34,


示例7: CRASH

void HandleSet::writeBarrier(HandleSlot slot, const JSValue& value){    // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.    // File a bug with stack trace if you hit this.    if (m_nextToFinalize)        CRASH();    if (!value == !*slot && slot->isCell() == value.isCell())        return;    Node* node = toNode(slot);#if ENABLE(GC_VALIDATION)    if (!isLiveNode(node))        CRASH();#endif    SentinelLinkedList<Node>::remove(node);    if (!value || !value.isCell()) {        m_immediateList.push(node);        return;    }    m_strongList.push(node);#if ENABLE(GC_VALIDATION)    if (!isLiveNode(node))        CRASH();#endif}
开发者ID:jiezh,项目名称:h5vcc,代码行数:27,


示例8: jsXPathEvaluatorPrototypeFunctionEvaluate

EncodedJSValue JSC_HOST_CALL jsXPathEvaluatorPrototypeFunctionEvaluate(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    JSXPathEvaluator* castedThis = jsDynamicCast<JSXPathEvaluator*>(thisValue);    if (!castedThis)        return throwVMTypeError(exec);    ASSERT_GC_OBJECT_INHERITS(castedThis, JSXPathEvaluator::info());    XPathEvaluator& impl = castedThis->impl();    ExceptionCode ec = 0;    const String& expression(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    Node* contextNode(toNode(exec->argument(1)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    RefPtr<XPathNSResolver> customResolver;    XPathNSResolver* resolver = toXPathNSResolver(exec->argument(2));    if (!resolver) {        customResolver = JSCustomXPathNSResolver::create(exec, exec->argument(2));        if (exec->hadException())            return JSValue::encode(jsUndefined());        resolver = customResolver.get();    }    uint16_t type(toUInt16(exec, exec->argument(3), NormalConversion));    if (exec->hadException())        return JSValue::encode(jsUndefined());    XPathResult* inResult(toXPathResult(exec->argument(4)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.evaluate(expression, contextNode, resolver, type, inResult, ec)));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:34,


示例9: toNode

bool EventTarget::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture){    // FIXME: listener null check should throw TypeError (and be done in    // generated bindings), but breaks legacy content. http://crbug.com/249598    if (!listener)        return false;    V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld();    if (activityLogger) {        Vector<String> argv;        argv.append(toNode() ? toNode()->nodeName() : interfaceName());        argv.append(eventType);        activityLogger->logEvent("blinkAddEventListener", argv.size(), argv.data());    }    return ensureEventTargetData().eventListenerMap.add(eventType, listener, useCapture);}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:17,


示例10: impl

JSValue* JSNodeFilter::acceptNode(ExecState* exec, const ArgList& args){    JSValue* exception = 0;    short result = impl()->acceptNode(toNode(args[0]), exception);    if (exception)        exec->setException(exception);    return jsNumber(exec, result);}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:8,


示例11: impl

JSValuePtr JSNode::appendChild(ExecState* exec, const ArgList& args){    ExceptionCode ec = 0;    bool ok = impl()->appendChild(toNode(args.at(exec, 0)), ec, true);    setDOMException(exec, ec);    if (ok)        return args.at(exec, 0);    return jsNull();}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:9,


示例12: impl

JSValue JSNode::removeChild(ExecState* exec, const ArgList& args){    ExceptionCode ec = 0;    bool ok = impl()->removeChild(toNode(args.at(0)), ec);    setDOMException(exec, ec);    if (ok)        return args.at(0);    return jsNull();}
开发者ID:ShouqingZhang,项目名称:webkitdriver,代码行数:9,


示例13: setJSTestInterfaceImplementsNode

void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* thisObject, JSValue value){    UNUSED_PARAM(exec);    JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);    TestInterface& impl = castedThis->impl();    Node* nativeValue(toNode(value));    if (exec->hadException())        return;    impl.setImplementsNode(nativeValue);}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:10,


示例14: jsNodePrototypeFunctionIsEqualNode

JSValue* jsNodePrototypeFunctionIsEqualNode(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSNode::s_info))        return throwError(exec, TypeError);    JSNode* castedThisObj = static_cast<JSNode*>(thisValue);    Node* imp = static_cast<Node*>(castedThisObj->impl());    Node* other = toNode(args[0]);    KJS::JSValue* result = jsBoolean(imp->isEqualNode(other));    return result;}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:12,


示例15: switch

void JSTreeWalker::putValueProperty(ExecState* exec, int token, JSValue* value){    switch (token) {    case CurrentNodeAttrNum: {        TreeWalker* imp = static_cast<TreeWalker*>(impl());        ExceptionCode ec = 0;        imp->setCurrentNode(toNode(value), ec);        setDOMException(exec, ec);        break;    }    }}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:12,


示例16: jsXPathEvaluatorPrototypeFunctionCreateNSResolver

JSValue* jsXPathEvaluatorPrototypeFunctionCreateNSResolver(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSXPathEvaluator::s_info))        return throwError(exec, TypeError);    JSXPathEvaluator* castedThisObj = static_cast<JSXPathEvaluator*>(thisValue);    XPathEvaluator* imp = static_cast<XPathEvaluator*>(castedThisObj->impl());    Node* nodeResolver = toNode(args[0]);    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createNSResolver(nodeResolver)));    return result;}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:12,


示例17: jsUndefined

JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec, const ArgList& args){    if (args.size() < 3)        return jsUndefined();    Node* node = toNode(args.at(0));    if (!node)        return jsUndefined();    bool withChildren = args.at(1).toBoolean(exec);    bool selectInUI = args.at(2).toBoolean(exec);    return jsNumber(exec, impl()->pushNodePathToFrontend(node, withChildren, selectInUI));}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:13,


示例18: jsRangePrototypeFunctionSurroundContents

JSValue* jsRangePrototypeFunctionSurroundContents(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSRange::s_info))        return throwError(exec, TypeError);    JSRange* castedThisObj = static_cast<JSRange*>(thisValue);    Range* imp = static_cast<Range*>(castedThisObj->impl());    ExceptionCode ec = 0;    Node* newParent = toNode(args[0]);    imp->surroundContents(newParent, ec);    setDOMException(exec, ec);    return jsUndefined();}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:13,


示例19: jsUndefined

JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec){    if (exec->argumentCount() < 3)        return jsUndefined();    Node* node = toNode(exec->argument(0));    if (!node)        return jsUndefined();    bool withChildren = exec->argument(1).toBoolean(exec);    bool selectInUI = exec->argument(2).toBoolean(exec);    return jsNumber(impl()->pushNodePathToFrontend(node, withChildren, selectInUI));}
开发者ID:dslab-epfl,项目名称:warr,代码行数:13,


示例20: search

static JSValueRef search(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/){    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));    if (!controller)        return JSValueMakeUndefined(ctx);    if (argumentCount < 2 || !JSValueIsString(ctx, arguments[1]))        return JSValueMakeUndefined(ctx);    Node* node = toNode(toJS(arguments[0]));    if (!node)        return JSValueMakeUndefined(ctx);    JSStringRef string = JSValueToStringCopy(ctx, arguments[1], 0);    String target(JSStringGetCharactersPtr(string), JSStringGetLength(string));    JSStringRelease(string);    JSObjectRef globalObject = JSContextGetGlobalObject(ctx);    JSStringRef constructorString = JSStringCreateWithUTF8CString("Array");    JSObjectRef arrayConstructor = JSValueToObject(ctx, JSObjectGetProperty(ctx, globalObject, constructorString, 0), 0);    JSStringRelease(constructorString);    JSObjectRef array = JSObjectCallAsConstructor(ctx, arrayConstructor, 0, 0, 0);    JSStringRef pushString = JSStringCreateWithUTF8CString("push");    JSValueRef pushValue = JSObjectGetProperty(ctx, array, pushString, 0);    JSStringRelease(pushString);    JSObjectRef push = JSValueToObject(ctx, pushValue, 0);    RefPtr<Range> searchRange(rangeOfContents(node));    int exception = 0;    do {        RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));        if (resultRange->collapsed(exception))            break;        // A non-collapsed result range can in some funky whitespace cases still not        // advance the range's start position (4509328). Break to avoid infinite loop.        VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);        if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))            break;        KJS::JSLock lock;        JSValueRef arg0 = toRef(toJS(toJS(ctx), resultRange.get()));        JSObjectCallAsFunction(ctx, push, array, 1, &arg0, 0);        setStart(searchRange.get(), newStart);    } while (true);    return array;}
开发者ID:FilipBE,项目名称:qtextended,代码行数:51,


示例21: jsRangePrototypeFunctionCompareNode

JSValue* jsRangePrototypeFunctionCompareNode(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSRange::s_info))        return throwError(exec, TypeError);    JSRange* castedThisObj = static_cast<JSRange*>(thisValue);    Range* imp = static_cast<Range*>(castedThisObj->impl());    ExceptionCode ec = 0;    Node* refNode = toNode(args[0]);    KJS::JSValue* result = jsNumber(exec, imp->compareNode(refNode, ec));    setDOMException(exec, ec);    return result;}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:14,


示例22: jsRangePrototypeFunctionSetEnd

JSValue* jsRangePrototypeFunctionSetEnd(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args){    if (!thisValue->isObject(&JSRange::s_info))        return throwError(exec, TypeError);    JSRange* castedThisObj = static_cast<JSRange*>(thisValue);    Range* imp = static_cast<Range*>(castedThisObj->impl());    ExceptionCode ec = 0;    Node* refNode = toNode(args[0]);    int offset = args[1]->toInt32(exec);    imp->setEnd(refNode, offset, ec);    setDOMException(exec, ec);    return jsUndefined();}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:14,



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


C++ toNumber函数代码示例
C++ toMapCoordinates函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。