Select Git revision
CONTROL_EA5
Directory.pm 3.98 KiB
#
# scan directory with note files in Tomboy format
#
=head1 NAME
Tomboy::Directory
=head1 SYNOPSIS
=head1 DESCRIPTION
process a directory containing note files in Tomboy format
=head1 SYNOPSIS
my $tb_dir= new Tomboy::Directory;
$tb_toc= $tb_dir->scan_dir ($directory);
=cut
package Tomboy::Directory;
use strict;
use Data::Dumper;
$Data::Dumper::Indent= 1;
use Tomboy::Note::Simple;
# attributes read from the note itself or from the filesystem
my @TB_note_attrs= qw(title create-date last-change-date last-metadata-change-date notebook is_template fnm);
my @TB_meta_attrs= qw(uuid mtime size ino);
=head1 METHODS
=head2 my $tb_dir= new Tomboy::Directory()
creates a new directory object
=cut
sub new
{
my $class= shift;
my %par= @_;
my $obj= {};
bless $obj, $class;
foreach my $par (keys %par)
{
$obj->{$par}= $par{$par};
if ($par eq 'dir') { $obj->scan_dir ($par{$par}) }
}
$obj;
}
=head2 $tb_dir->scan_dir ($directory, ($rows, $quick]))
Scan named directory for Tomboy notes and extract key features using
Tomboy::Note::Simple. These features are placed into a record and all
these records are returned as array reference.
Optionally pass an array reference of such records as $rows and when
$quick has a true value, the note files are only processed when they
do not appear to be modified, otherwise the earlier record is passed in
the result set.
=cut