Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

ProjectFile * cbProject::GetFileByFilename ( const wxString &  filename,
bool  isRelative = true,
bool  isUnixFilename = false 

Access a file of the project.

filename The filename of the file.
isRelative True if filename is a relative filename, false if not.
isUnixFilename True if filename is already normalized with UnixFilename(), false if not.
A pointer to the file or NULL if not found.

Definition at line 1414 of file cbproject.cpp.

References CompileTargetBase::GetBasePath().

Referenced by AddFile(), and wxsItemRes::OnDeleteCleanup().

    // m_ProjectFilesMap keeps UnixFilename(ProjectFile::relativeFilename)
    wxString tmp = filename;
    if (!isRelative)
        // if the search is not relative, make it
        wxFileName fname(filename);
        tmp = fname.GetFullPath();
        // make sure filename doesn't start with ".\"
        // our own relative files don't have it, so the search would fail
        // this happens when importing MS projects...
        if (tmp.StartsWith(_T(".\\")) ||
            tmp.Remove(0, 2);

    if (isUnixFilename)
        return m_ProjectFilesMap[tmp];
    return m_ProjectFilesMap[UnixFilename(tmp)];

Generated by  Doxygen 1.6.0   Back to index