|
NAMETree::Simple::View::ASCII - A class for viewing Tree::Simple hierarchies in ASCIISYNOPSISuse Tree::Simple::View::ASCII; my $tree_view = Tree::Simple::View::ASCII->new($tree); $tree_view->includeTrunk(1); print $tree_view->expandAll(); # root # |---Node Level: 1 # | |---Node Level: 1.1 # | |---Node Level: 1.2 # | | |---Node Level: 1.2.1 # | | \---Node Level: 1.2.2 # | \---Node Level: 1.3 # |---Node Level: 2 # | |---Node Level: 2.1 # | \---Node Level: 2.2 # |---Node Level: 3 # | \---Node Level: 3.1 # | |---Node Level: 3.1.1 # | \---Node Level: 3.1.2 # \---Node Level: 4 # \---Node Level: 4.1 print $tree_view->expandPath("root", "Node Level: 1", "Node Level: 1.2"); # root # |---Node Level: 1 # | |---Node Level: 1.1 # | |---Node Level: 1.2 # | | |---Node Level: 1.2.1 # | | \---Node Level: 1.2.2 # | \---Node Level: 1.3 # |---Node Level: 2 # |---Node Level: 3 # \---Node Level: 4 my $tree_view = Tree::Simple::View::ASCII->new($tree, ( characters => [ indent => " ", pipe => " | ", last_branch => " \- ", branch => " |- " ] ) ); # root # |- Node Level: 1 # | |- Node Level: 1.1 # | |- Node Level: 1.2 # | | |- Node Level: 1.2.1 # | | \- Node Level: 1.2.2 # | \- Node Level: 1.3 # |- Node Level: 2 # |- Node Level: 3 # \- Node Level: 4 DESCRIPTIONThis is a Tree::Simple::View subclass which provides simple ASCII formatting for trees.I had this code lying around, and I figured it was best to put it into here. This is an early release of this, and it lacks configuration parameter handling, but that can be easily added later when I need it. METHODS
TODOConfig handling, allowing you to customize the drawing. Patches welcome, I just don't currently have the time to add it.Repository<https://github.com/ronsavage/Tree-Simple.git>SUPPORTBugs should be reported via the CPAN bug tracker at<https://github.com/ronsavage/Tree-Simple/issues> AUTHORstevan little, <stevan@iinteractive.com>COPYRIGHT AND LICENSECopyright 2004-2008 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.
Visit the GSP FreeBSD Man Page Interface. |