#include "global.h" #include #include #include "SongCacheIndex.h" #include "RageLog.h" #include "RageUtil.h" #include "song.h" SongCacheIndex *SONGINDEX; SongCacheIndex::SongCacheIndex() { mkdir("Cache", 0755); CacheIndex.SetPath( "Cache/index.cache" ); ReadCacheIndex(); } SongCacheIndex::~SongCacheIndex() { } void SongCacheIndex::ReadCacheIndex() { CacheIndex.ReadFile(); // don't care if this fails int iCacheVersion; CacheIndex.GetValueI( "Cache", "CacheVersion", iCacheVersion ); if( iCacheVersion == FILE_CACHE_VERSION ) return; /* OK */ LOG->Trace( "Cache format is out of date. Deleting all cache files." ); CStringArray asCacheFileNames; GetDirListing( "Cache/*", asCacheFileNames ); for( unsigned i=0; i