本文整理汇总了C++中ObjectRef::getPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectRef::getPointer方法的具体用法?C++ ObjectRef::getPointer怎么用?C++ ObjectRef::getPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectRef
的用法示例。
在下文中一共展示了ObjectRef::getPointer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JO
QString Stringify::JO(ObjectRef o)
{
if (stack.contains(o.getPointer())) {
ctx->throwTypeError();
return QString();
}
Scope scope(ctx);
QString result;
stack.push(o.getPointer());
QString stepback = indent;
indent += gap;
QStringList partial;
if (propertyList.isEmpty()) {
ObjectIterator it(scope, o, ObjectIterator::EnumerableOnly);
ScopedValue name(scope);
ScopedValue val(scope);
while (1) {
name = it.nextPropertyNameAsString(val);
if (name->isNull())
break;
QString key = name->toQString();
QString member = makeMember(key, val);
if (!member.isEmpty())
partial += member;
}
} else {
ScopedString s(scope);
for (int i = 0; i < propertyList.size(); ++i) {
bool exists;
s = propertyList.at(i);
ScopedValue v(scope, o->get(s, &exists));
if (!exists)
continue;
QString member = makeMember(s->toQString(), v);
if (!member.isEmpty())
partial += member;
}
}
if (partial.isEmpty()) {
result = QStringLiteral("{}");
} else if (gap.isEmpty()) {
result = QStringLiteral("{") + partial.join(QLatin1Char(',')) + QStringLiteral("}");
} else {
QString separator = QStringLiteral(",\n") + indent;
result = QStringLiteral("{\n") + indent + partial.join(separator) + QStringLiteral("\n") + stepback + QStringLiteral("}");
}
indent = stepback;
stack.pop();
return result;
}
示例2: scope
ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags)
: object(ObjectRef::fromValuePointer(scratch1))
, current(ObjectRef::fromValuePointer(scratch2))
, arrayNode(0)
, arrayIndex(0)
, memberIndex(0)
, flags(flags)
{
object = o.getPointer();
current = o.getPointer();
if (!!object && object->asArgumentsObject()) {
Scope scope(object->engine());
Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate();
}
}
示例3: ExecutionContext
WithContext::WithContext(ExecutionEngine *engine, ObjectRef with)
: ExecutionContext(engine, Type_WithContext)
{
callData = parent->callData;
outer = parent;
lookups = parent->lookups;
compilationUnit = parent->compilationUnit;
withObject = with.getPointer();
}