]> mj.ucw.cz Git - pciids.git/blobdiff - PciIds/Address/PciClass.pm
Integrate ID syntax help
[pciids.git] / PciIds / Address / PciClass.pm
index 993efc2d79a584cc83031e9ca2dae457c0766ac9..f0ac79328218e42212e88fd3103e1285ce5e40f6 100644 (file)
@@ -29,19 +29,23 @@ sub pretty( $ ) {
 
 sub restrictRex( $$ ) {
        my( $self, $restrict ) = @_;
-       my( $result ) = ( $restrict =~ /^([a-f0-9]{1,4})/ );#TODO every time?
+       my( $result ) = ( $restrict =~ /^([a-f0-9]{1,2})/ );#TODO every time?
        return $result;
 }
 
 sub leaf( $ ) {
-       #TODO
+       return shift->get() =~ /\/.*\/.*\//;
 }
 
 sub append( $$ ) {
        my( $self, $suffix ) = @_;
        return ( undef, 'You can not add to leaf node' ) if( $self->leaf() );
        return ( undef, "Invalid ID syntax" ) unless ( $suffix =~ /^[0-9a-f]{2,2}$/ );
-       return ( PciIds::Address::Base::new( $self->{'value'} . ( ( $self->{'value'} =~ /\/$/ ) ? '' : '/' ) . $suffix ), undef );
+       return ( PciIds::Address::new( $self->{'value'} . ( ( $self->{'value'} =~ /\/$/ ) ? '' : '/' ) . $suffix ), undef );
+}
+
+sub helpName( $ ) {
+       return 'pci_class';
 }
 
 1;