Exemplo n.º 1
0
bool TagEntry::TypedefFromPattern(const wxString& tagPattern,
                                  const wxString& typedefName,
                                  wxString& name,
                                  wxString& templateInit,
                                  bool nameIncludeTemplate)
{
    wxString pattern(tagPattern);

    pattern.StartsWith(wxT("/^"), &pattern);
    const wxCharBuffer cdata = pattern.mb_str(wxConvUTF8);

    clTypedefList li;
    get_typedefs(cdata.data(), li);

    if(li.size() == 1) {
        clTypedef td = *li.begin();
        templateInit = _U(td.m_realType.m_templateDecl.c_str());
        if(td.m_realType.m_typeScope.empty() == false) {
            name << _U(td.m_realType.m_typeScope.c_str());
            if(nameIncludeTemplate) {
                name << templateInit;
            }
            name << wxT("::");
        }

        name << _U(td.m_realType.m_type.c_str());
        return true;
    }
    return false;
}
Exemplo n.º 2
0
void testTypedefParser(char *buf)
{
    printf("===== Testing Typedef parser ======\n");
    clTypedefList li;


    std::map<std::string, std::string> ignoreTokens;
    get_typedefs(buf, li);
    for (clTypedefList::iterator iter = li.begin(); iter != li.end(); iter++) {
        clTypedef var = *iter;
        var.print();
    }
    printf("matches found: %d\n", li.size());
}