Esempio n. 1
0
void Project::GetFiles(wxStringSet_t& files, const wxString& relativePath)
{
    DirSaver ds;
    FileNameVector_t v;
    ::wxSetWorkingDirectory(relativePath);
    GetFiles(m_doc.GetRoot(), v, false);
    for(size_t i=0; i<v.size(); i++) {
        v.at(i).MakeRelativeTo(relativePath);
        files.insert(v.at(i).GetFullPath());
    }
}
void CompilationDatabase::Initialize()
{
    Open();
    if(!IsOpened()) return;

    // get list of files created by cmake
    FileNameVector_t files = GetCompileCommandsFiles();

    // pick codelite's compilation database created by codelite-cc
    // - convert it to compile_commands.json
    // - append it the list of files
    wxFileName clCustomCompileFile = GetFileName();
    clCustomCompileFile.SetExt("db.txt");
    if(clCustomCompileFile.Exists()) {
        wxFileName compile_commands = ConvertCodeLiteCompilationDatabaseToCMake(clCustomCompileFile);
        if(compile_commands.IsOk()) {
            files.push_back(compile_commands);
        }
    }
    // Sort the files by modification time
    std::sort(files.begin(), files.end(), wxFileNameSorter());

    for(size_t i = 0; i < files.size(); ++i) {
        ProcessCMakeCompilationDatabase(files.at(i));
    }
}
Esempio n. 3
0
void Project::GetFiles(wxStringSet_t& files)
{
    DirSaver ds;
    FileNameVector_t v;
    ::wxSetWorkingDirectory(m_fileName.GetPath());
    GetFiles(m_doc.GetRoot(), v, true);
    for(size_t i=0; i<v.size(); i++) {
        files.insert(v.at(i).GetFullPath());
    }
}