/[webpac]/trunk2/lib/WebPAC/Index.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/lib/WebPAC/Index.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 410 by dpavlin, Sun Sep 5 21:40:57 2004 UTC revision 511 by dpavlin, Sun Oct 17 17:35:32 2004 UTC
# Line 24  Create new sorted index object Line 24  Create new sorted index object
24    
25   my $thes = new WebPAC::Index(   my $thes = new WebPAC::Index(
26          log => 'log4perl.conf',          log => 'log4perl.conf',
27            name => 'index name',
28   );   );
29    
30  C<log> is optional parametar which specify filename of L<Log::Log4Perl>  C<log> is optional parametar which specify filename of L<Log::Log4Perl>
31  config file. Default is C<log.conf>.  config file. Default is C<log.conf>.
32    
33    C<name> is optional parametar used to mark lines in log file with index
34    name.
35    
36  Default sort function is my C<headline>, non case sensitive. It can't be  Default sort function is my C<headline>, non case sensitive. It can't be
37  changed right now without editing of source.  changed right now without editing of source.
38    
# Line 54  sub new { Line 58  sub new {
58  Insert data into index  Insert data into index
59    
60   $index->insert(   $index->insert(
         path => 'path',  
61          headline => 'headline text',          headline => 'headline text',
62            mfn => '99',
63   );   );
64    
65  =cut  =cut
# Line 65  sub insert { Line 69  sub insert {
69    
70          my $data = {@_};          my $data = {@_};
71    
         confess("need path and headline!") unless (defined($data->{'path'}) && defined($data->{'headline'}));  
   
72          my $log = $self->_get_logger();          my $log = $self->_get_logger();
73    
74            $log->logconfess("need headline and mfn!") unless (defined($data->{'headline'}) && defined($data->{'mfn'}));
75    
76          push @{$self->{'index'}}, $data;          push @{$self->{'index'}}, $data;
77    
78          $log->debug("stored path: ",$data->{'path'}," headline: ",$data->{'headline'});          my $name = '';
79            $name = $self->{'name'}." " if ($self->{'name'});
80    
81            $log->debug("stored ",$name,$data->{'mfn'},": ",$data->{'headline'});
82    
83  }  }
84    

Legend:
Removed from v.410  
changed lines
  Added in v.511

  ViewVC Help
Powered by ViewVC 1.1.26