@@ -624,6 +624,7 @@ void FileUtils::purgeCachedEntries()
624624{
625625 DECLARE_GUARD;
626626 _fullPathCache.clear ();
627+ _fullPathCacheDir.clear ();
627628}
628629
629630std::string FileUtils::getStringFromFile (const std::string& filename) const
@@ -935,6 +936,7 @@ void FileUtils::setSearchResolutionsOrder(const std::vector<std::string>& search
935936 bool existDefault = false ;
936937
937938 _fullPathCache.clear ();
939+ _fullPathCacheDir.clear ();
938940 _searchResolutionsOrderArray.clear ();
939941 for (const auto & iter : searchResolutionsOrder)
940942 {
@@ -1010,6 +1012,7 @@ void FileUtils::setDefaultResourceRootPath(const std::string& path)
10101012 if (_defaultResRootPath != path)
10111013 {
10121014 _fullPathCache.clear ();
1015+ _fullPathCacheDir.clear ();
10131016 _defaultResRootPath = path;
10141017 if (!_defaultResRootPath.empty () && _defaultResRootPath[_defaultResRootPath.length ()-1 ] != ' /' )
10151018 {
@@ -1028,6 +1031,7 @@ void FileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
10281031 _originalSearchPaths = searchPaths;
10291032
10301033 _fullPathCache.clear ();
1034+ _fullPathCacheDir.clear ();
10311035 _searchPathArray.clear ();
10321036
10331037 for (const auto & path : _originalSearchPaths)
@@ -1084,6 +1088,7 @@ void FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict)
10841088{
10851089 DECLARE_GUARD;
10861090 _fullPathCache.clear ();
1091+ _fullPathCacheDir.clear ();
10871092 _filenameLookupDict = filenameLookupDict;
10881093}
10891094
@@ -1115,7 +1120,6 @@ std::string FileUtils::getFullPathForFilenameWithinDirectory(const std::string&
11151120 ret += ' /' ;
11161121 }
11171122 ret += filename;
1118-
11191123 // if the file doesn't exist, return an empty string
11201124 if (!isFileExistInternal (ret)) {
11211125 ret = " " ;
@@ -1164,8 +1168,8 @@ bool FileUtils::isDirectoryExist(const std::string& dirPath) const
11641168 }
11651169
11661170 // Already Cached ?
1167- auto cacheIter = _fullPathCache .find (dirPath);
1168- if ( cacheIter != _fullPathCache .end () )
1171+ auto cacheIter = _fullPathCacheDir .find (dirPath);
1172+ if ( cacheIter != _fullPathCacheDir .end () )
11691173 {
11701174 return isDirectoryExistInternal (cacheIter->second );
11711175 }
@@ -1179,7 +1183,7 @@ bool FileUtils::isDirectoryExist(const std::string& dirPath) const
11791183 fullpath = fullPathForDirectory (searchIt + dirPath + resolutionIt);
11801184 if (isDirectoryExistInternal (fullpath))
11811185 {
1182- _fullPathCache .emplace (dirPath, fullpath);
1186+ _fullPathCacheDir .emplace (dirPath, fullpath);
11831187 return true ;
11841188 }
11851189 }
0 commit comments