Пример #1
0
bool CppRefType::add(const WrapperStr & t, Q3PtrList<CppRefType> & l, bool incl)
{
    if (t.isEmpty())
        return FALSE;

    static Q3Dict<char> cpp_builtin_types;

    if (cpp_builtin_types.count() == 0) {
        cpp_builtin_types.insert("unsigned", " ");
        cpp_builtin_types.insert("signed", " ");
        cpp_builtin_types.insert("char", " ");
        cpp_builtin_types.insert("short", " ");
        cpp_builtin_types.insert("int", " ");
        cpp_builtin_types.insert("long", " ");
        cpp_builtin_types.insert("float", " ");
        cpp_builtin_types.insert("double", " ");
        cpp_builtin_types.insert("bool", " ");
        cpp_builtin_types.insert("void", " ");
    }

    if (cpp_builtin_types[t] != 0)
        return TRUE;

    CppRefType * ref;
    Weight w = (incl) ? Medium : Low;

    for (ref = l.first(); ref; ref = l.next()) {
        if (ref->type.toString() == t) {
            if (w > ref->weight)
                ref->included = incl;

            return TRUE;
        }
    }

    l.append(new CppRefType(t, incl, w));
    return TRUE;
}