FileCache
Object Hierarchy:
Shumate.FileCache
Shumate.FileCache
Shumate.FileCache
GLib.Object
GLib.Object
GLib.Object->Shumate.FileCache
Description:
[
CCode ( type_id =
"shumate_file_cache_get_type ()" ) ]
public sealed class FileCache :
Object
A cache that stores and retrieves tiles from the file system.
It is mainly used by [class@TileDownloader], but can also be used by custom data sources.
The cache will be filled up to a certain size limit. When this limit is reached, the cache can be purged, and the tiles that are accessed least
are deleted.
ETags
The cache can optionally store an ETag string with each tile. This is useful to avoid redownloading old tiles that haven't changed (for
example, using the HTTP If-None-Match header).
Content:
Properties:
public string cache_dir { get ; construct ; }
The directory where the tile database is stored.
public string cache_key { get ; construct ; }
The key used to store and retrieve tiles from the cache.
public uint size_limit { get ; set construct ; }
The cache size limit in bytes.
Creation methods:
Methods:
public unowned string get_cache_dir ()
Gets the directory where the cache database is stored.
public unowned string get_cache_key ()
Gets the key used to store and retrieve tiles from the cache.
public uint get_size_limit ()
Gets the cache size limit in bytes.
public async Bytes get_tile_async (int x, int y, int zoom_level, Cancellable ? cancellable, out string ? etag, out DateTime ? modtime) throws Error
Gets tile data from the cache, if it is available.
public void mark_up_to_date (int x, int y, int zoom_level)
Marks a tile in the cache as being up to date, without changing its data.
public async bool purge_cache_async (Cancellable ? cancellable) throws Error
Removes less used tiles from the cache, if necessary, until it fits in the
size limit.
public void set_size_limit (uint size_limit)
Sets the cache size limit in bytes.
public async bool store_tile_async (int x, int y, int zoom_level, Bytes bytes, string ? etag, Cancellable ? cancellable) throws Error
Stores a tile in the cache.
Inherited Members:
All known members inherited from class GLib.Object