/[suikacvs]/messaging/manakai/lib/Message/Field/CSV.pm
Suika

Diff of /messaging/manakai/lib/Message/Field/CSV.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Sun Mar 31 13:11:55 2002 UTC revision 1.5 by wakaba, Mon Apr 1 05:32:15 2002 UTC
# Line 19  use strict; Line 19  use strict;
19  use re 'eval';  use re 'eval';
20  use vars qw(%OPTION %REG $VERSION);  use vars qw(%OPTION %REG $VERSION);
21  $VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};  $VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
22  use overload '@{}' => sub {[shift->value]},  use overload '@{}' => sub {shift->value},
23               '""' => sub {shift->stringify};               '""' => sub {shift->stringify};
24  require Message::Util;  require Message::Util;
25  $REG{comment} = qr/\x28(?:\x5C[\x00-\xFF]|[\x00-\x0C\x0E-\x27\x2A-\x5B\x5D-\xFF]+|(??{$REG{comment}}))*\x29/;  $REG{comment} = qr/\x28(?:\x5C[\x00-\xFF]|[\x00-\x0C\x0E-\x27\x2A-\x5B\x5D-\xFF]+|(??{$REG{comment}}))*\x29/;
# Line 83  sub _init_option ($) { Line 83  sub _init_option ($) {
83      $self->{option}->{separator_long} = ', ';      $self->{option}->{separator_long} = ', ';
84      $self->{option}->{long_count} = 5;      $self->{option}->{long_count} = 5;
85      $self->{option}->{value_unsafe_rule} = 'NON_component';      $self->{option}->{value_unsafe_rule} = 'NON_component';
86        $self->{option}->{encoding_after_encode} = 'utf-8';
87    } elsif ($field_name eq 'distribution') {    } elsif ($field_name eq 'distribution') {
88      $self->{option}->{separator} = ',';      $self->{option}->{separator} = ',';
89      $self->{option}->{separator_long} = ', ';      $self->{option}->{separator_long} = ', ';
# Line 159  sub _parse_list ($$) { Line 160  sub _parse_list ($$) {
160    
161  =head2 $self->value ()  =head2 $self->value ()
162    
163  Returns value list.  Returns array reference to value list.
164    
165  =cut  =cut
166    
167  sub value ($) {@{shift->{value}}}  sub value ($) {shift->{value}}
168    
169  =head2 $self->add ($value, [%option])  =head2 $self->add ($value, [%option])
170    
# Line 242  sub option ($$;$) { Line 243  sub option ($$;$) {
243    $self->{option}->{$name};    $self->{option}->{$name};
244  }  }
245    
246    sub value_type ($;$%) {
247      my $self = shift;
248      my $new_value_type = shift;
249      if ($new_value_type) {
250        $self->{option}->{value_type}->[0] = $new_value_type;
251      }
252      $self->{option}->{value_type}->[0] || ':none:';
253    }
254    
255  sub _delete_empty ($) {  sub _delete_empty ($) {
256    my $self = shift;    my $self = shift;
257    my @nid;    my @nid;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24