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 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
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref