UMMF::MOF::Format::IDLIdentifier2 - A transformer for MOF 1.4 IDL Identifier Format 2.


UMMF documentation Contained in the UMMF distribution.

Index


Code Index:

NAME

Top

UMMF::MOF::Format::IDLIdentifier2 - A transformer for MOF 1.4 IDL Identifier Format 2.

SYNOPSIS

Top

  use UMMF::MOF::Format::IDLIdentifier2;

  my $x = UMMF::MOF::Format::IDLIdentifier2->new;
  $x->transform('DSTC pty ltd') eq 'dstc_pty_ltd';

DESCRIPTION

Top

Implements the IDL Identifier Format 2 as described in MOF 1.4 p.5-45.

USAGE

Top

EXPORT

Top

None exported.

AUTHOR

Top

Kurt Stephens, ks.perl@kurtstephens.com 2003/05/25

SEE ALSO

Top

UMMF

VERSION

Top

$Revision: 1.1 $

METHODS

Top


UMMF documentation Contained in the UMMF distribution.

package UMMF::MOF::Format::IDLIdentifier2;

use 5.6.1;
use strict;
#use warnings;


our $AUTHOR = q{ ks.perl@kurtstephens.com 2003/05/25 };
our $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d." . "%03d" x $#r, @r };

####################################################################################

use base qw(UMMF::MOF::Format::IDLIdentifierBase);

####################################################################################


sub transform
{
  my ($self, $x) = @_;
  
  my $w = $self->split_words($x);
  
  my $y = join('_', map(lc, @$w));

  print STDERR "'$x' => '$y'\n";

  $y;
}

####################################################################################


sub UNIT_TEST
{
  my ($self) = @_;

  $self ||= __PACKAGE__;

  $self->SUPER::UNIT_TEST
  (
   [
    [ 'foo',               'foo' ],
    [ 'foo_bar',           'foo_bar' ],
    [ 'ALPHAbeticalOrder', 'alphabetical_order' ],
    [ '-a1B2c3-d4-',       'a1_b2c3_d4' ],
    [ 'DSTC pty ltd',      'dstc_pty_ltd' ],
    ]
   );		   
}


####################################################################################

1;

####################################################################################


### Keep these comments at end of file: ks.perl@kurtstephens.com 2003/04/06 ###
### Local Variables: ###
### mode:perl ###
### perl-indent-level:2 ###
### perl-continued-statement-offset:0 ###
### perl-brace-offset:0 ###
### perl-label-offset:0 ###
### End: ###