/[jsFind]/trunk/jsFind.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 /trunk/jsFind.pm

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

revision 1 by dpavlin, Sun Jul 11 20:18:25 2004 UTC revision 8 by dpavlin, Wed Jul 21 15:44:15 2004 UTC
# Line 86  sub new { Line 86  sub new {
86    
87  Search, insert, append or replace data in B-Tree  Search, insert, append or replace data in B-Tree
88    
89     $t->B_search(
90            Key => 'key value',
91            Data => { "path" => {
92                            "t" => "title of document",
93                            "f" => 99,
94                            },
95                    },
96            Insert => 1,
97            Append => 1,
98     );
99    
100  Semantics:  Semantics:
101    
# Line 304  sub to_jsfind { Line 313  sub to_jsfind {
313          my $path = shift || confess "to_jsfind need path to your index!";          my $path = shift || confess "to_jsfind need path to your index!";
314    
315          $path .= "/" if ($path =~ /\/$/);          $path .= "/" if ($path =~ /\/$/);
316          carp "can't create index in '$path': $!" if (! -w $path);          carp "create directory for index '$path': $!" if (! -w $path);
317    
318          return $self->root->to_jsfind($path,"0");          return $self->root->to_jsfind($path,"0");
319  }  }
# Line 686  sub to_dot { Line 695  sub to_dot {
695    
696  Create jsFind xml files  Create jsFind xml files
697    
698   my $nr=$tree->to_dot('/path/to/index','0');   my $nr=$tree->to_jsfind('/path/to/index','0');
699    
700  Returns number of elements created  Returns number of elements created
701    
# Line 698  sub to_jsfind { Line 707  sub to_jsfind {
707    
708          return 0 if $self->is_empty;          return 0 if $self->is_empty;
709    
710            confess("path is undefined.") unless ($path);
711            confess("file is undefined. Did you call \$t->root->to_jsfind(..) instead of \$t->to_jsfind(..) ?") unless (defined($file));
712    
713          my $nr_keys = 0;          my $nr_keys = 0;
714    
715          my ($k, $d, $s) = @$self;          my ($k, $d, $s) = @$self;

Legend:
Removed from v.1  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26