]> mj.ucw.cz Git - pciids.git/blob - PciIds/Address.pm
Help for notifications
[pciids.git] / PciIds / Address.pm
1 package PciIds::Address;
2 use strict;
3 use warnings;
4 use PciIds::Address::Pci;
5 use PciIds::Address::PciClass;
6
7 sub new( $ ) {
8         my( $address ) = @_;
9         $address =~ s/\/(mods|read|static)//;#Eat the prefix
10         $address =~ s/\/$//;
11         $address =~ s/^\///;
12         if( $address =~ /^PC/ ) {
13                 return PciIds::Address::Pci::new( $address );
14         } elsif( $address =~ /^PD/ ) {
15                 return PciIds::Address::PciClass::new( $address );
16         } else {
17                 return undef;
18         }
19 }
20
21 1;