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


C++ ObjectRef::getPointer方法代码示例

本文整理汇总了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;
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:56,代码来源:qv4jsonobject.cpp

示例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();
    }
}
开发者ID:tizenorg,项目名称:platform.upstream.qtdeclarative,代码行数:16,代码来源:qv4objectiterator.cpp

示例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();
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:10,代码来源:qv4context.cpp


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