Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision de4b1e97

Von Bernd Bleßmann vor fast 11 Jahren hinzugefügt

  • ID de4b1e970660f9ab8ef22e357cc87639cb9be85e
  • Vorgänger 43010559
  • Nachfolger ffb54c7e

case_insensitive-Flag für Multiplex-Daten anpassen.

Unterschiede anzeigen:

SL/Helper/Csv.pm
169 169
  # mopst likely meant that field, so rewrite the header
170 170
  if ($self->case_insensitive_header) {
171 171
    die 'case_insensitive_header is only possible with profile' unless $self->profile;
172
    my @names = (
173
      keys %{ $self->profile || {} },
174
    );
175
    for my $name (@names) {
176
      for my $i (0..$#$header) {
177
        $header->[$i] = $name if lc $header->[$i] eq lc $name;
172
    if ($header) {
173
      my $p_num = 0;
174
      foreach my $h (@{ $header }) {
175
        my @names = (
176
          keys %{ $self->profile->[$p_num]->{profile} || {} },
177
        );
178
        for my $name (@names) {
179
          for my $i (0..$#$h) {
180
            $h->[$i] = $name if lc $h->[$i] eq lc $name;
181
          }
182
        }
183
        $p_num++;
178 184
      }
179 185
    }
180 186
  }
......
448 454
will have to do that for yourself. Since you provided the profile, it is
449 455
assumed you know what to do in this case.
450 456

  
457
If no profile is given, any header field found will be taken as is.
458

  
459
If the path in a profile entry is empty, the field will be subjected to
460
C<strict_profile> and C<case_insensitive_header> checking, will be parsed into
461
C<get_data>, but will not be attempted to be dispatched into objects.
462

  
451 463
If C<class> is present, the line will be handed to the new sub of this class,
452 464
and the return value used instead of the line itself.
453 465

  

Auch abrufbar als: Unified diff