const wxExVCSEntry wxExVCS::FindEntry(const wxExFileName& filename) { const int vcs = wxConfigBase::Get()->ReadLong("VCS", VCS_AUTO); if (vcs == VCS_AUTO) { if (filename.IsOk()) { for (const auto& it : m_Entries) { const bool toplevel = it.AdminDirIsTopLevel(); const std::string admin_dir = it.GetAdminDir(); if (toplevel && IsAdminDirTopLevel(admin_dir, filename)) { return it; } else if (IsAdminDir(admin_dir, filename)) { return it; } } } } else if (vcs >= VCS_START && vcs < (int)m_Entries.size()) { return m_Entries[vcs]; } return wxExVCSEntry(); }
const wxExVCSEntry wxExVCS::FindEntry(const wxFileName& filename) { const int vcs = wxConfigBase::Get()->ReadLong("VCS", VCS_AUTO); if (vcs == VCS_AUTO) { if (filename.IsOk()) { for ( auto it = m_Entries.begin(); it != m_Entries.end(); ++it) { const bool toplevel = it->AdminDirIsTopLevel(); const wxString admin_dir = it->GetAdminDir(); if (toplevel && IsAdminDirTopLevel(admin_dir, filename)) { return *it; } else if (IsAdminDir(admin_dir, filename)) { return *it; } } } } else if (vcs >= VCS_START && vcs < m_Entries.size()) { return m_Entries[vcs]; } return wxExVCSEntry(); }
bool wxExVCS::DirExists(const wxExFileName& filename) { const wxExVCSEntry entry(FindEntry(filename)); if ( entry.AdminDirIsTopLevel() && IsAdminDirTopLevel(entry.GetAdminDir(), filename)) { return true; } else { return IsAdminDir(entry.GetAdminDir(), filename); } }