本文整理汇总了C++中TreeWalker类的典型用法代码示例。如果您正苦于以下问题:C++ TreeWalker类的具体用法?C++ TreeWalker怎么用?C++ TreeWalker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TreeWalker类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
JSValue* JSTreeWalker::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case RootAttrNum: {
TreeWalker* imp = static_cast<TreeWalker*>(impl());
return toJS(exec, WTF::getPtr(imp->root()));
}
case WhatToShowAttrNum: {
TreeWalker* imp = static_cast<TreeWalker*>(impl());
return jsNumber(exec, imp->whatToShow());
}
case FilterAttrNum: {
TreeWalker* imp = static_cast<TreeWalker*>(impl());
return toJS(exec, WTF::getPtr(imp->filter()));
}
case ExpandEntityReferencesAttrNum: {
TreeWalker* imp = static_cast<TreeWalker*>(impl());
return jsBoolean(imp->expandEntityReferences());
}
case CurrentNodeAttrNum: {
TreeWalker* imp = static_cast<TreeWalker*>(impl());
return toJS(exec, WTF::getPtr(imp->currentNode()));
}
}
return 0;
}
示例2: parentNodeCallback
static v8::Handle<v8::Value> parentNodeCallback(const v8::Arguments& args)
{
TreeWalker* imp = V8TreeWalker::toNative(args.Holder());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return v8Undefined();
ScriptState& state = *currentState;
RefPtr<Node> result = imp->parentNode(&state);
if (state.hadException()) {
v8::Local<v8::Value> exception = state.exception();
state.clearException();
return throwError(exception, args.GetIsolate());
}
return toV8(result.release(), args.Holder(), args.GetIsolate());
}
示例3: currentNodeAttrGetter
static v8::Handle<v8::Value> currentNodeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
return toV8Fast(imp->currentNode(), info, imp);
}
示例4: expandEntityReferencesAttrGetter
static v8::Handle<v8::Value> expandEntityReferencesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
return v8Boolean(imp->expandEntityReferences(), info.GetIsolate());
}
示例5: whatToShowAttrGetter
static v8::Handle<v8::Value> whatToShowAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
return v8UnsignedInteger(imp->whatToShow(), info.GetIsolate());
}