|  |  |  | Evolution-Data-Server Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
struct EFileCache; struct EFileCacheClass; EFileCache * e_file_cache_new (const gchar *filename); gboolean e_file_cache_remove (EFileCache *cache); gboolean e_file_cache_clean (EFileCache *cache); const gchar * e_file_cache_get_object (EFileCache *cache,const gchar *key); GSList * e_file_cache_get_objects (EFileCache *cache); GSList * e_file_cache_get_keys (EFileCache *cache); gboolean e_file_cache_add_object (EFileCache *cache,const gchar *key,const gchar *value); gboolean e_file_cache_replace_object (EFileCache *cache,const gchar *key,const gchar *new_value); gboolean e_file_cache_remove_object (EFileCache *cache,const gchar *key); void e_file_cache_freeze_changes (EFileCache *cache); void e_file_cache_thaw_changes (EFileCache *cache); const gchar * e_file_cache_get_filename (EFileCache *cache);
An EFileCache is a simple hash table of strings backed by an XML file
for permanent storage.  The XML file is written to disk with every unless
the cache is temporarily frozen with e_file_cache_freeze_changes().
struct EFileCache {
	GObject parent;
	EFileCachePrivate *priv;
};
Contains only private data that should be read and manipulated using the functions below.
EFileCache *        e_file_cache_new                    (const gchar *filename);
Creates a new EFileCache object, which implements a cache of objects. Useful for remote backends.
| 
 | filename where the cache is kept | 
| Returns : | a new EFileCache | 
gboolean            e_file_cache_remove                 (EFileCache *cache);
Remove the cache from disk.
| 
 | an EFileCache | 
| Returns : | TRUEif successful,FALSEif a file error occurred | 
gboolean            e_file_cache_clean                  (EFileCache *cache);
Clean up the cache's contents.
| 
 | an EFileCache | 
| Returns : | TRUEalways | 
const gchar * e_file_cache_get_object (EFileCache *cache,const gchar *key);
Returns the object corresponding to key.  If no such object exists
in cache, the function returns NULL.
| 
 | an EFileCache | 
| 
 | the hash key of the object to find | 
| Returns : | the object corresponding to key | 
GSList *            e_file_cache_get_objects            (EFileCache *cache);
Returns a list of objects in cache.  The objects are owned by cache and
must not be modified or freed.  Free the returned list with g_slist_free().
| 
 | an EFileCache | 
| Returns : | a list of objects | 
GSList *            e_file_cache_get_keys               (EFileCache *cache);
Returns a list of keys in cache.  The keys are owned by cache and must
not be modified or freed.  Free the returned list with g_slist_free().
| 
 | an EFileCache | 
| Returns : | a list of keys | 
gboolean e_file_cache_add_object (EFileCache *cache,const gchar *key,const gchar *value);
Adds a new key / value entry to cache.  If an object corresponding
to key already exists in cache, the function returns FALSE.
| 
 | an EFileCache | 
| 
 | the hash key of the object to add | 
| 
 | the object to add | 
| Returns : | TRUEif successful,FALSEifkeyalready exists | 
gboolean e_file_cache_replace_object (EFileCache *cache,const gchar *key,const gchar *new_value);
Replaces the object corresponding to key with new_value.
If no such object exists in cache, the function returns FALSE.
| 
 | an EFileCache | 
| 
 | the hash key of the object to replace | 
| 
 | the new object for key | 
| Returns : | TRUEif successful,FALSEifkeywas not found | 
gboolean e_file_cache_remove_object (EFileCache *cache,const gchar *key);
Removes the object corresponding to key from cache.
If no such object exists in cache, the function returns FALSE.
| 
 | an EFileCache | 
| 
 | the hash key of the object to remove | 
| Returns : | TRUEif successful,FALSEifkeywas not found | 
void                e_file_cache_freeze_changes         (EFileCache *cache);
Disables temporarily all writes to disk for cache.
| 
 | an EFileCache | 
void                e_file_cache_thaw_changes           (EFileCache *cache);
Reverts the affects of e_file_cache_freeze_changes().
Each change to cache is once again written to disk.
| 
 | an EFileCache | 
const gchar *       e_file_cache_get_filename           (EFileCache *cache);
Gets the name of the file where the cache is being stored.
| 
 | A EFileCacheobject. | 
| Returns : | The name of the cache. |