Hub::Data::HashFile

- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
- INTERNAL
- AUTHOR
- COPYRIGHT
- UPDATED

# NAME

Hub::Data::HashFile - Flat file data which supports nested perl structures.

Part of the Hub Library

Top

# SYNOPSIS

        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

Top

# DESCRIPTION

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.

Top

# METHODS

clear | getTimestamp | load | refresh | setRoot
data | get_root | mergein | save | writeToDisk
data_hash | hffmt | new | saveCopy
format | hfsync | print | set
get | include | readFromDisk | setOption

clear

data

                                 D E P R I C A T E D

data_hash

  depricated, please use method `data()`

format

get

getTimestamp

get_root

  depricated, please use method `data()`

hffmt

  Static methods

hfsync

  Sync all modified instances to disk

include

load

  Read and parse the file from disk.

  This is a singleton per filename.

mergein

new

print

readFromDisk

refresh

       Usage: refresh

  Sync disk data into ourselves Hub object method

save

saveCopy

set

setOption

       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.

setRoot

writeToDisk

Top

# INTERNAL

AUTOLOAD | DESTROY | _init

AUTOLOAD

       Usage: AUTOLOAD

  Data handlers: getv takev setv appendv

DESTROY

       Usage: DESTROY

  Defining this function prevents it from being searched in AUTOLOAD

_init

Top

# AUTHOR

Ryan Gies

Top

# COPYRIGHT

Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.

Copyright (c) 2000-2005 Ryan Gies. All rights reserved.

Top

# UPDATED

This file created by on at

Top