#include "stdafx.h" #include "SongCacheIndex.h" #include "RageLog.h" #include "RageUtil.h" #include "Song.h" SongCacheIndex *SONGINDEX; SongCacheIndex::SongCacheIndex() { 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