CWCacheManager


Discussion

This class is used to provide a generic superclass for cache management with regard to various CWFolder sub-classes. CWIMAPFolder, CWLocalFolder and CWPOP3Folder can make use of a cache in order to speedup lots of operations.

Superclass

NSObject

Declared In

CWCacheManager.h



Methods

-count
-initWithPath:
-invalidate
-path
-setPath:
-synchronize

count


- (unsigned int) count; 
Return Value

The count;

Discussion

This method returns the number of cache_record entries present in the cache.


initWithPath:


- (id) initWithPath: (NSString *) thePath; 
Parameters
thePath

The complete path where the cache will be eventually saved to.

Return Value

A CWCacheManager subclass instance, nil on error.

Discussion

This method is the designated initializer for the CWCacheManager class.


invalidate


- (void) invalidate; 
Discussion

This method is used to invalide all cache entries.


path


- (NSString *) path; 
Return Value

The path.

Discussion

This method is used to obtain the path where the cache has been loaded for or where it'll be saved to.


setPath:


- (void) setPath: (NSString *) thePath; 
Parameters
thePath

The complete path.

Discussion

This method is used to set the path where the cache will be loaded from or where it'll be saved to.


synchronize


- (BOOL) synchronize; 
Return Value

YES on success, NO otherwise.

Discussion

This method is used to save the cache on disk. If the cache is empty, this method does not write it on disk and returns YES.


Member Data

_cache
_count
_fd
_path

_cache


protected

NSMutableArray *_cache;

_count


protected

unsigned int _count;

_fd


protected

int _fd;

_path


protected

NSString *_path;