Authored by Justin R. Miller

added method for database cache file size retrieval

@@ -73,4 +73,7 @@ @@ -73,4 +73,7 @@
73 * @param theExpiryPeriod The amount of time to elapse before a tile should be removed from the cache. If set to zero, tile count-based purging will be used instead of time-based. */ 73 * @param theExpiryPeriod The amount of time to elapse before a tile should be removed from the cache. If set to zero, tile count-based purging will be used instead of time-based. */
74 - (void)setExpiryPeriod:(NSTimeInterval)theExpiryPeriod; 74 - (void)setExpiryPeriod:(NSTimeInterval)theExpiryPeriod;
75 75
  76 +/** The current file size of the database cache on disk. */
  77 +- (unsigned long long)fileSize;
  78 +
76 @end 79 @end
@@ -178,6 +178,11 @@ @@ -178,6 +178,11 @@
178 srand(time(NULL)); 178 srand(time(NULL));
179 } 179 }
180 180
  181 +- (unsigned long long)fileSize
  182 +{
  183 + return [[[NSFileManager defaultManager] attributesOfItemAtPath:self.databasePath error:nil] fileSize];
  184 +}
  185 +
181 - (UIImage *)cachedImage:(RMTile)tile withCacheKey:(NSString *)aCacheKey 186 - (UIImage *)cachedImage:(RMTile)tile withCacheKey:(NSString *)aCacheKey
182 { 187 {
183 // RMLog(@"DB cache check for tile %d %d %d", tile.x, tile.y, tile.zoom); 188 // RMLog(@"DB cache check for tile %d %d %d", tile.x, tile.y, tile.zoom);