![]() |
![]() |
![]() |
Camel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
struct CamelDataCache; CamelDataCache * camel_data_cache_new (const
,gchar *path); const
GError **errorgchar * camel_data_cache_get_path (CamelDataCache *cdc
);void camel_data_cache_set_path (CamelDataCache *cdc
,const
);gchar *pathvoid camel_data_cache_set_expire_age (CamelDataCache *cdc
,);
time_t whenvoid camel_data_cache_set_expire_access (CamelDataCache *cdc
,); CamelStream * camel_data_cache_add (
time_t whenCamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key); CamelStream * camel_data_cache_get (
GError **errorCamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **errorgint camel_data_cache_remove (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **errorgchar * camel_data_cache_get_filename (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **errorvoid camel_data_cache_clear (CamelDataCache *cdc
,const
);gchar *path
CamelDataCache * camel_data_cache_new (const
,gchar *path);
GError **error
Create a new data cache.
|
Base path of cache, subdirectories will be created here. |
|
return location for a NULL |
Returns : |
A new cache object, or NULL if the base path cannot be written to. |
constgchar * camel_data_cache_get_path (CamelDataCache *cdc
);
Returns the path to the data cache.
|
a CamelDataCache |
Returns : |
the path to the data cache |
Since 2.32
void camel_data_cache_set_path (CamelDataCache *cdc
,const
);gchar *path
Sets the path to the data cache.
|
a CamelDataCache |
|
path to the data cache |
Since 2.32
void camel_data_cache_set_expire_age (CamelDataCache *cdc
,);
time_t when
Set the cache expiration policy for aged entries.
Items in the cache older than when
seconds may be
flushed at any time. Items are expired in a lazy
manner, so it is indeterminate when the items will
physically be removed.
Note you can set both an age and an access limit. The age acts as a hard limit on cache entries.
|
A CamelDataCache |
|
Timeout for age expiry, or -1 to disable. |
void camel_data_cache_set_expire_access (CamelDataCache *cdc
,);
time_t when
Set the cache expiration policy for access times.
Items in the cache which haven't been accessed for when
seconds may be expired at any time. Items are expired in a lazy
manner, so it is indeterminate when the items will
physically be removed.
Note you can set both an age and an access limit. The age acts as a hard limit on cache entries.
|
A CamelDataCache |
|
Timeout for access, or -1 to disable access expiry. |
CamelStream * camel_data_cache_add (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **error
Add a new item to the cache.
The key and the path combine to form a unique key used to store the item.
Potentially, expiry processing will be performed while this call is executing.
|
A CamelDataCache |
|
Relative path of item to add. |
|
Key of item to add. |
|
return location for a NULL |
Returns : |
A CamelStream (file) opened in read-write mode. The caller must unref this when finished. |
CamelStream * camel_data_cache_get (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **error
Lookup an item in the cache. If the item exists, a stream is returned for the item. The stream may be shared by multiple callers, so ensure the stream is in a valid state through external locking.
|
A CamelDataCache |
|
Path to the (sub) cache the item exists in. |
|
Key for the cache item. |
|
return location for a NULL |
Returns : |
A cache item, or NULL if the cache item does not exist. |
gint camel_data_cache_remove (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **error
Remove/expire a cache item.
|
A CamelDataCache |
|
return location for a NULL |
gchar * camel_data_cache_get_filename (CamelDataCache *cdc
,const
,gchar *pathconst
,gchar *key);
GError **error
Lookup the filename for an item in the cache
|
A CamelDataCache |
|
Path to the (sub) cache the item exists in. |
|
Key for the cache item. |
|
return location for a NULL |
Returns : |
The filename for a cache item |
Since 2.26
void camel_data_cache_clear (CamelDataCache *cdc
,const
);gchar *path
Clear cache's content in path
.
|
a CamelDataCache |
|
Path to the (sub) cache the item exists in. |
Since 3.2