Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 29. marec 2024

Súbor: [Platon] / iotta / Iotta / Format / Auto.pm (stiahnutie)

Revízia 1.2, Sun Mar 23 11:29:56 2003 UTC (21 years ago) by yenar


Zmeny od 1.1: +2 -2 [lines]

use chain-provided module instantiation [Iotta/Format/Auto.pm]

package Iotta::Format::Auto;
use base Iotta::Elem;

sub run {
    my $s = shift;
    my $m = shift;
    my $in = shift;
    my $fi;
    my $fo;
    my $infmt = $$m{format};
    $infmt =~ s/^(.)/$a = $1; $a =~ tr@a-z@A-Z@; $a/e;
    $infmt =~ s/[-_](.)/$a = $1; $a =~ tr@a-z@A-Z@; $a/ge;
    $infmt =~ s/-/_/g;
    $fi = $s->chain->mod_inst("Iotta::Format::In::".$infmt); #FIXME?
    $fo = $s->chain->mod_inst("Iotta::Format::Out::".$s->outfmt);
    $fi->next ($fo);
    $fo->next ($s -> next);
    #$s->next->run ($m, $out) if ($s->next);
    $fi->run ($m, $in);
}

sub setup {
    my $self = shift;
    my $o = shift;
    $self->{outfmt} = $$o{format};
}

sub initialize {
    my $self = shift;
    $self->SUPER::initialize (@_);
}
1;

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok