Code::Blocks
SVN r11506
|
Public Member Functions | |
HeaderDirTraverser (wxThread *thread, wxCriticalSection *critSect, SystemHeadersMap &headersMap, const wxString &searchDir) | |
~HeaderDirTraverser () override | |
wxDirTraverseResult | OnFile (const wxString &filename) override |
call back function when we meet a file More... | |
wxDirTraverseResult | OnDir (const wxString &dirname) override |
call back function when we meet a dir More... | |
Public Member Functions inherited from wxDirTraverser | |
virtual wxDirTraverseResult | OnOpenError (const wxString &openerrorname) |
Private Member Functions | |
void | AddLock (bool is_file) |
this function will be called every time we meet a file or a dir, and we count the file and dir, we temporary leave the critical section to give other thread a change to access the file maps. More... | |
wxDirTraverseResult | GetStatus (const wxString &path) |
Private Attributes | |
wxThread * | m_Thread |
wxCriticalSection * | m_SystemHeadersThreadCS |
const SystemHeadersMap & | m_SystemHeadersMap |
const wxString & | m_SearchDir |
StringSet & | m_Headers |
bool | m_Locked |
indicates whether the critical section is entered or not, used in AddLock() function More... | |
size_t | m_Dirs |
size_t | m_Files |
Definition at line 59 of file systemheadersthread.cpp.
HeaderDirTraverser::HeaderDirTraverser | ( | wxThread * | thread, |
wxCriticalSection * | critSect, | ||
SystemHeadersMap & | headersMap, | ||
const wxString & | searchDir | ||
) |
Definition at line 239 of file systemheadersthread.cpp.
|
override |
Definition at line 254 of file systemheadersthread.cpp.
References wxCriticalSection::Leave(), m_Locked, and m_SystemHeadersThreadCS.
|
private |
this function will be called every time we meet a file or a dir, and we count the file and dir, we temporary leave the critical section to give other thread a change to access the file maps.
As the traversing may take a long time, in the same time, the UI may need to show the code completion prompt for header files, so a critical section is used here.
Definition at line 319 of file systemheadersthread.cpp.
References _T, wxCriticalSection::Enter(), wxCriticalSection::Leave(), m_Dirs, m_Files, m_Locked, m_SystemHeadersThreadCS, and TRACE.
|
private |
Definition at line 341 of file systemheadersthread.cpp.
References m_SystemHeadersMap, wxDIR_CONTINUE, and wxDIR_IGNORE.
Referenced by OnDir().
|
overridevirtual |
call back function when we meet a dir
Implements wxDirTraverser.
Definition at line 281 of file systemheadersthread.cpp.
References AddLock(), wxString::Append(), cbResolveSymLinkedDirPathRecursive(), wxString::empty(), GetStatus(), wxString::Last(), m_Thread, wxThread::TestDestroy(), wxString::utf8_str(), wxDIR_IGNORE, and wxDIR_STOP.
|
overridevirtual |
call back function when we meet a file
Implements wxDirTraverser.
Definition at line 260 of file systemheadersthread.cpp.
References _T, AddLock(), wxString::GetChar(), wxFileName::GetExt(), wxFileName::GetFullPath(), wxFileName::HasExt(), m_Headers, m_SearchDir, m_Thread, wxFileName::MakeRelativeTo(), wxString::Replace(), wxThread::TestDestroy(), wxDIR_CONTINUE, and wxDIR_STOP.
|
private |
Definition at line 127 of file systemheadersthread.cpp.
Referenced by AddLock().
|
private |
Definition at line 130 of file systemheadersthread.cpp.
Referenced by AddLock().
|
private |
Definition at line 121 of file systemheadersthread.cpp.
Referenced by OnFile().
|
private |
indicates whether the critical section is entered or not, used in AddLock() function
Definition at line 124 of file systemheadersthread.cpp.
Referenced by AddLock(), and ~HeaderDirTraverser().
|
private |
Definition at line 116 of file systemheadersthread.cpp.
Referenced by OnFile().
|
private |
Definition at line 93 of file systemheadersthread.cpp.
Referenced by GetStatus().
|
private |
Definition at line 86 of file systemheadersthread.cpp.
Referenced by AddLock(), and ~HeaderDirTraverser().
|
private |
Definition at line 83 of file systemheadersthread.cpp.