NAME

Perl::Dist::WiX::DirectoryCache - Cache of <Directory> tag objects.

VERSION

This document describes Perl::Dist::WiX::DirectoryCache version 1.250.

SYNOPSIS

# Since this is a singleton, ->instance() retrieves the cache object
# (creating the cache object if needed)
my $cache = Perl::Dist::WiX::DirectoryCache->instance();

$cache->add_to_cache($directory_object, $fragment_object);

my $exists = $cache->exists_in_cache($directory_object);

my $fragment_id = $cache->get_previous_fragment($directory_object);

$cache->delete_cache_entry($directory_object);

DESCRIPTION

This object is a singleton designed to cache objects representing all directories to be created by a Perl::Dist::WiX-based installer.

The cache is used during the regenerate_fragments task so that a directory (defined by a Perl::Dist::WiX::Tag::Directory object) is only defined once, no matter how many fragments it is used in. (There can be as many references to a directory, defined by Perl::Dist::WiX::Tag::DirectoryRef objects, as required.)

INTERFACE

instance

Returns the cache object. (Use this instead of new().)

add_to_cache

$cache->add_to_cache($directory_object, $fragment_object);

This method adds the directory object to the cache, and references the fact that it is being created in the fragment object.

exists_in_cache

my $exists = $cache->exists_in_cache($directory_object);

This method returns a true value if a directory object representing the same directory is already in the cache. Otherwise, it returns a false value.

get_previous_fragment

my $fragment_id = $cache->get_previous_fragment($directory_object);

This method returns the ID of the fragment that's already creating this directory. If there is no fragment already creating this directory, this method returns an undefined value.

delete_cache_entry

$cache->delete_cache_entry($directory_object);

This method removes the ID of the fragment that's already assigned to this directory in the cache.

This method is used when a directory that two or more fragments want to create is added to the directory tree object instead.

delete_cache_entry

$cache->clear_cache();

This clears the cache for a new build.

DIAGNOSTICS

See Perl::Dist::WiX::Diagnostics for a list of exceptions that this module can throw.

BUGS AND LIMITATIONS (SUPPORT)

Bugs should be reported via:

1) The CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist-WiX if you have an account there.

2) Email to <bug-Perl-Dist-WiX@rt.cpan.org> if you do not.

For other issues, contact the topmost author.

AUTHORS

Curtis Jewell <csjewell@cpan.org>

Adam Kennedy <adamk@cpan.org>

SEE ALSO

Perl::Dist::WiX, http://ali.as/, http://csjewell.comyr.com/perl/

COPYRIGHT AND LICENSE

Copyright 2009 - 2010 Curtis Jewell.

Copyright 2008 - 2009 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this distribution.