From 0301b8366b1cd0ae39ff92589f75be70746cfe3a Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Thu, 19 Sep 2002 14:34:15 -0400 Subject: Add a way to remove files from cache --- Source/cmListFileCache.cxx | 10 ++++++++++ Source/cmListFileCache.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 83dd3cf..0b6e0b8 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -109,3 +109,13 @@ bool cmListFileCache::CacheFile(const char* path) m_ListFileCache[path] = inFile; return true; } + +void cmListFileCache::FlushCache(const char* path) +{ + ListFileMap::iterator it = m_ListFileCache.find(path); + if ( it != m_ListFileCache.end() ) + { + m_ListFileCache.erase(it); + return; + } +} diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index f2362db..cd15a31 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -55,6 +55,10 @@ public: * NULL is returned. */ cmListFile* GetFileCache(const char* path); + + //! Flush cache file out of cache. + void FlushCache(const char* path); + private: // Cache the file bool CacheFile(const char* path); -- cgit v0.12