|
NAMETree::Simple::Visitor::CreateDirectoryTree - A Visitor for create a set of directories and files from a Tree::Simple object SYNOPSIS use Tree::Simple::Visitor::CreateDirectoryTree;
# create a Tree::Simple object which
# represents a directory hierarchy
my $tree = Tree::Simple->new("www/")
->addChildren(
Tree::Simple->new("conf/")
->addChildren(
Tree::Simple->new("startup.pl"),
Tree::Simple->new("httpd.conf")
),
Tree::Simple->new("cgi-bin/"),
Tree::Simple->new("ht_docs/"),
Tree::Simple->new("logs/")
->addChildren(
Tree::Simple->new("error.log"),
Tree::Simple->new("access.log")
),
);
# create an instance of our visitor
my $visitor = Tree::Simple::Visitor::CreateDirectoryTree->new();
# pass the visitor to a Tree::Simple object
$tree->accept($visitor);
# the www/ directory now mirrors the structure of the tree
DESCRIPTIONThis visitor can be used to create a set of directories and files from a Tree::Simple object hierarchy. METHODS
Repository<https://github.com/ronsavage/Tree-Simple-VisitorFactory> SUPPORTBugs should be reported via the CPAN bug tracker at <https://github.com/ronsavage/Tree-Simple-VisitorFactory/issues> CODE COVERAGESee the CODE COVERAGE section in Tree::Simple::VisitorFactory for more information. SEE ALSOThese Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that module for more information. AUTHORstevan little, <stevan@iinteractive.com> COPYRIGHT AND LICENSECopyright 2004, 2005 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|