Hub::Data::HashFile - Flat file data which supports nested perl structures.
Part of the Hub Library
use Hub; my $hf = Hub::mkinst('HashFile','myfile.hf');
$hf->set( "eye_color", "green" ); # set a simple property $hf->save(); # saves the file to disk
HashFiles are used for property files and small databases.
There will be one and only one HashFile instance for each file. If a second HashFile instance is created and is asked to load a file which is already represented, this second instance is replaced with a reference to the first.
clear | getTimestamp | load | refresh | setRoot |
data | get_root | mergein | save | writeToDisk |
data_hash | hffmt | new | saveCopy | |
format | hfsync | set | ||
get | include | readFromDisk | setOption |
D E P R I C A T E D
depricated, please use method data()
depricated, please use method data()
Static methods
Sync all modified instances to disk
Read and parse the file from disk.
This is a singleton per filename.
Usage: refresh
Sync disk data into ourselves Hub object method
Usage: setOption KEY VALUE
Sets an option for this instance.
KEY can be:
preserve_comments 0 or 1, We will write out comments
backup Set the number of backups you want to keep
write_behind 0 or 1, Do not write to disk on save() but mark it as dirty, and defer to the hfsync() method.
AUTOLOAD | DESTROY | _init |
Usage: AUTOLOAD
Data handlers: getv takev setv appendv
Usage: DESTROY
Defining this function prevents it from being searched in AUTOLOAD
Ryan Gies
Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.
Copyright (c) 2000-2005 Ryan Gies. All rights reserved.
This file created by on at