CacheFile - Manager for Simple Cache Files
Shane P. McCarron <shane@aptest.com>
Copyright 2002-2011 Applied Testing and Technology, Inc. All Rights Reserved.
use CacheFile; Open the cache Database for writing my $db = new CacheFile(suite, name, 1); get a handle to the whole requirements database $data = $db->allEntries(); get a handle to a specific cache entry $data = $db->entry(name) release the database $db-E<gt>release();
The CacheFile object is a generic multi-level data structure storage facility. The data stored in this facility is keyed by the pathname associated with each requirement.
$cdb = new CacheFile(suite, name, [read/write [, timeout[, path]]]);
Creates a new cache database object, optionally opening a non-default target file and optionally making it writeable.
Name of the test suite we are operating within.
Name of the cache file to open
boolean set to True if the database needs to be writeable or False if it can be readOnly.
the number of seconds to wait for a lock. Defaults to 60 seconds.
a path to an alternate database (the default is implementation defined).
returns a reference to the requirements database object.
$hRef = $cdb->allEntries( [data] ) ;
data is a reference to a hash of data for the cache. If supplied, the entire cache will be replaced with that data.
Returns a reference to a hash in which all the entries from the cache are stored. Note that this is NOT a reference to the tied hash. Data is copied out of the tied hash into memory.
$cdb->delete( entry ) ;
$entryRef = $cdb->entry( name [, data ] ) ;
name is the name of a cache entry.
data is an optional reference to new data for the cached item.
Returns a reference to the data in the cache entry. If data is supplied, first updates the cache entry with that data.
Removes all entries from the cache file - should have a Lock before calling this.
returns true if it succeeded, false if it did not.
$numEntries = $cdb->numEntries;
returns a path to the cache file.
$rdb->print(); $rdb->print(UUID);
returns the string-ified version of the entire database, or just the contents of the requirement UUID.
$cdb->release() ;
returns the path saved into, or undef if the save failed.
Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.