Top | ![]() |
![]() |
![]() |
![]() |
EFileCache * | e_file_cache_new () |
|
e_file_cache_remove () |
|
e_file_cache_clean () |
const |
e_file_cache_get_object () |
|
e_file_cache_get_objects () |
|
e_file_cache_get_keys () |
|
e_file_cache_add_object () |
|
e_file_cache_replace_object () |
|
e_file_cache_remove_object () |
|
e_file_cache_freeze_changes () |
|
e_file_cache_thaw_changes () |
const |
e_file_cache_get_filename () |
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()
.
EFileCache *
e_file_cache_new (const gchar *filename
);
Creates a new EFileCache object, which implements a cache of objects. Useful for remote backends.
gboolean e_file_cache_remove (EFileCache *cache
);
Remove the cache from disk.
gboolean e_file_cache_clean (EFileCache *cache
);
Clean up the cache's contents.
constgchar * 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
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()
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()
gboolean e_file_cache_add_object (EFileCache *cache
,const
,gchar *keyconst
);gchar *value
Adds a new key
/ value
entry to cache
. If an object corresponding
to key
already exists in cache
, the function returns FALSE
gboolean e_file_cache_replace_object (EFileCache *cache
,const
,gchar *keyconst
);gchar *new_value
Replaces the object corresponding to key
with new_value
.
If no such object exists in cache
, the function returns FALSE
cache |
an EFileCache |
|
key |
the hash key of the object to replace |
|
new_value |
the new object for |
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
void e_file_cache_freeze_changes (EFileCache *cache
);
Disables temporarily all writes to disk for cache
.
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.
constgchar * e_file_cache_get_filename (EFileCache *cache
);
Gets the name of the file where the cache is being stored.