~ubuntu-branches/ubuntu/trusty/lxr-cvs/trusty

« back to all changes in this revision

Viewing changes to lib/LXR/Index.pm

  • Committer: Bazaar Package Importer
  • Author(s): Giacomo Catenazzi
  • Date: 2004-01-27 20:34:44 UTC
  • Revision ID: james.westby@ubuntu.com-20040127203444-kb8xobdp8j1z8owi
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- tab-width: 4 -*- ###############################################
 
2
#
 
3
# $Id: Index.pm,v 1.9 2001/08/15 15:50:27 mbox Exp $
 
4
 
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; either version 2 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU General Public License for more details.
 
14
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program; if not, write to the Free Software
 
17
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 
 
19
package LXR::Index;
 
20
 
 
21
$CVSID = '$Id: Index.pm,v 1.9 2001/08/15 15:50:27 mbox Exp $ ';
 
22
 
 
23
use LXR::Common;
 
24
use strict;
 
25
 
 
26
sub new {
 
27
        my ($self, $dbname, @args) = @_;
 
28
        my $index;
 
29
 
 
30
        if ($dbname =~ /^DBI:/i) {
 
31
                require LXR::Index::DBI;
 
32
                $index = new LXR::Index::DBI($dbname, @args);
 
33
        }
 
34
        elsif ($dbname =~ /^DBM:/i) {
 
35
          require LXR::Index::DB;
 
36
          $index = new LXR::Index::DB($dbname, @args);
 
37
        }
 
38
        else {
 
39
          die "Can't find database, $dbname";
 
40
        }
 
41
        return $index;
 
42
}
 
43
 
 
44
# TODO: Add skeleton code here to define the Index interface
 
45
 
 
46
1;