예제 #1
0
EnumDataInformation::EnumDataInformation(QString name, PrimitiveDataInformation* type,
            EnumDefinition::Ptr enumDef, DataInformation* parent) :
    AbstractEnumDataInformation(name, enumDef, parent), mValue(type)
{
    Q_CHECK_PTR(type);
    if (enumDef->type() != type->type())
        kWarning() << "incompatible types in definition and value: "
                << enumDef->type() << "and " << type->type();
    mValue->setParent(this);
}
예제 #2
0
파일: osdparser.cpp 프로젝트: KDE/okteta
EnumDefinition::Ptr OsdParser::findEnum(const QString& defName, const OsdParserInfo& info)
{
    for (int i = 0; i < info.enums.size(); ++i)
    {
        const EnumDefinition::Ptr def = info.enums.at(i);
        if (def->name() == defName)
            return def;
    }
    info.error() << "Could not find enum definition with name" << defName;
    return EnumDefinition::Ptr(0);
}
예제 #3
0
EnumDefinition::Ptr OsdParser::findEnum(const QString& defName)
{
    for (int i = 0; i < mEnums.length(); ++i)
    {
        const EnumDefinition::Ptr def = mEnums.at(i);
        if (def->name() == defName)
        {
            kDebug() << "found at index: " << i;
            return def;
        }
    }
    kDebug() << "enum " << defName << "not found in enums list";
    return EnumDefinition::Ptr(0);
}