Ejemplo n.º 1
0
int CSysImageList::GetPathIconIndex(const CTGitPath& filePath) const
{
	CString strExtension = filePath.GetFileExtension();
	strExtension.MakeUpper();
	IconIndexMap::iterator it = m_indexCache.lower_bound(strExtension);
	if (it == m_indexCache.end() || strExtension < it->first)
	{
		// We don't have this extension in the map
		int iconIndex = GetFileIconIndex(filePath.GetFilename());
		it = m_indexCache.insert(it, std::make_pair(strExtension, iconIndex));
	}
	// We must have found it
	return it->second;
}
Ejemplo n.º 2
0
int CSysImageList::GetPathIconIndex(const CTSVNPath& filePath)
{
    CString strExtension = filePath.GetFileExtension();
    strExtension.MakeUpper();
    auto it = m_indexCache.lower_bound(strExtension);
    if (it == m_indexCache.end() || strExtension < it->first)
    {
        // We don't have this extension in the map
        int iconIndex = GetFileIconIndex(filePath.GetFilename());
        it = m_indexCache.emplace_hint(it, strExtension, iconIndex);
    }
    // We must have found it
    return it->second;
}