Index

Package: Cache

Description

private package Resources.Cache is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Subprograms & Entries

Load

function Load
( filepath: String;
group: String;
keep: Boolean;
needLock: Boolean ) return A_Resource_File;
Returns a Resource_File in the cache, or loads it if it hasn't been loaded. If 'needLock' is True, the cache's lock will be taken and released. null will be returned on error.

Preload

procedure Preload
( filepath: String;
group: String;
needLock: Boolean );
Preloads a file from disk if it hasn't been loaded, starting the reference count at 0. If 'needLock' is True, the cache's lock will be taken and released.

Unload

procedure Unload
( resource: in out A_Resource_File;
needLock: Boolean );
Releases a reference to a Resource_File in the cache. If all references to the resource have been released, the resource made be removed from the cache. If 'needLock' is True, the cache's lock will be taken and released.