projects
/
id3fs.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PathElement::*: implement id() method
[id3fs.git]
/
lib
/
ID3FS
/
PathElement
/
File.pm
1
package ID3FS::PathElement::File;
2
3
use strict;
4
use warnings;
5
6
sub new
7
{
8
my $proto=shift;
9
my $class=ref($proto) || $proto;
10
my $self={};
11
bless($self,$class);
12
13
$self->{db}=shift;
14
$self->{name}=shift;
15
$self->{id}=$self->{db}->lookup_id("files", $self->{name});
16
return(undef) unless(defined($self->{id}));
17
return $self;
18
}
19
20
sub type { return "file"; }
21
sub id { return shift->{id}; }
22
23
1;