![]() |
![]() |
![]() |
libchamplain Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
ChamplainFileCache; ChamplainFileCache* champlain_file_cache_new (void
); ChamplainFileCache* champlain_file_cache_new_full (guint size_limit
,const gchar *cache_dir
,gboolean persistent
); void champlain_file_cache_set_size_limit (ChamplainFileCache *file_cache
,guint size_limit
); guint champlain_file_cache_get_size_limit (ChamplainFileCache *file_cache
); const gchar * champlain_file_cache_get_cache_dir (ChamplainFileCache *file_cache
); void champlain_file_cache_purge (ChamplainFileCache *file_cache
); void champlain_file_cache_purge_on_idle (ChamplainFileCache *file_cache
);
GObject +----GInitiallyUnowned +----ChamplainMapSource +----ChamplainTileCache +----ChamplainFileCache
"cache-dir" gchar* : Read / Write / Construct Only "size-limit" guint : Read / Write / Construct
ChamplainFileCache is a map source that stores and retrieves tiles from the file system. It can be temporary (deleted when the object is destroyed) or permanent. Tiles most frequently loaded gain in "popularity". This popularity is taken into account when purging the cache.
ChamplainFileCache* champlain_file_cache_new (void
);
Default constructor of ChamplainFileCache.
Returns : |
a constructed permanent cache of maximal size 100000000 B inside ~/.cache/champlain. |
Since 0.6
ChamplainFileCache* champlain_file_cache_new_full (guint size_limit
,const gchar *cache_dir
,gboolean persistent
);
Constructor of ChamplainFileCache.
|
maximal size of the cache in bytes |
|
the directory where the cache is created. For temporary caches one more directory with random name is created inside this directory. When cache_dir == NULL, a cache in ~/.cache/champlain is used for permanent caches and /tmp for temporary caches. |
|
if TRUE, the cache is persistent; otherwise the cache is temporary and will be deleted when the cache object is destructed. |
Returns : |
a constructed ChamplainFileCache |
Since 0.6
void champlain_file_cache_set_size_limit (ChamplainFileCache *file_cache
,guint size_limit
);
Sets the cache size limit in bytes.
|
a ChamplainFileCache |
|
the cache limit in bytes |
Since 0.4
guint champlain_file_cache_get_size_limit (ChamplainFileCache *file_cache
);
Gets the cache size limit in bytes.
|
a ChamplainFileCache |
Returns : |
size limit |
Since 0.4
const gchar * champlain_file_cache_get_cache_dir (ChamplainFileCache *file_cache
);
Gets the directory where the cache database is stored.
|
a ChamplainFileCache |
Returns : |
the directory |
Since 0.6
void champlain_file_cache_purge (ChamplainFileCache *file_cache
);
Purge the cache from the less popular tiles until cache's size limit is reached.
|
a ChamplainFileCache |
Since 0.4
void champlain_file_cache_purge_on_idle (ChamplainFileCache *file_cache
);
Purge the cache from the less popular tiles until cache's size limit is reached. This is a non blocking call as the purge will happen when the application is idle
|
a ChamplainFileCache |
Since 0.4
"cache-dir"
property"cache-dir" gchar* : Read / Write / Construct Only
The directory where the tile database is stored.
Default value: NULL
Since 0.6
"size-limit"
property"size-limit" guint : Read / Write / Construct
The cache size limit in bytes.
Note: this new value will not be applied until you call champlain_cache_purge
Allowed values: [1,G_MAXINT]
Default value: 100000000
Since 0.4