35 |
-field_format_pattern => '%s: %s', |
-field_format_pattern => '%s: %s', |
36 |
-field_name_case_sensible => 0, |
-field_name_case_sensible => 0, |
37 |
-field_name_unsafe_rule => 'NON_ftext', |
-field_name_unsafe_rule => 'NON_ftext', |
38 |
-field_name_validation => 1, ## Method level option. |
-field_name_validation => 0, |
39 |
-field_sort => 0, |
-field_sort => 0, |
40 |
#-format => 'mail-rfc2822', |
#-format => 'mail-rfc2822', |
41 |
-header_default_charset => 'iso-2022-int-1', |
-header_default_charset => 'iso-2022-int-1', |
128 |
$self->{option}->{ns_default_phuri} = $self->{ns}->{phname2uri}->{'rfc822'} |
$self->{option}->{ns_default_phuri} = $self->{ns}->{phname2uri}->{'rfc822'} |
129 |
unless $self->{option}->{ns_default_phuri}; |
unless $self->{option}->{ns_default_phuri}; |
130 |
|
|
131 |
|
## For text/rfc822-headers |
132 |
|
if (ref $options{entity_header}) { |
133 |
|
$self->{entity_header} = $options{entity_header}; |
134 |
|
delete $options{entity_header}; |
135 |
|
} |
136 |
my @new_fields = (); |
my @new_fields = (); |
137 |
for my $name (keys %options) { |
for my $name (keys %options) { |
138 |
unless (substr ($name, 0, 1) eq '-') { |
unless (substr ($name, 0, 1) eq '-') { |
201 |
my $class = shift; |
my $class = shift; |
202 |
my $header = shift; |
my $header = shift; |
203 |
my $self = bless {}, $class; |
my $self = bless {}, $class; |
204 |
$self->_init (@_); ## BUG: don't check linebreak_strict |
$self->_init (@_); |
205 |
$header =~ s/\x0D?\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding}; |
if ($self->{option}->{linebreak_strict}) { |
206 |
|
$header =~ s/\x0D\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding}; |
207 |
|
} else { |
208 |
|
$header =~ s/\x0D?\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding}; |
209 |
|
} |
210 |
for my $field (split /\x0D?\x0A/, $header) { |
for my $field (split /\x0D?\x0A/, $header) { |
211 |
if ($field =~ /$REG{M_fromline}/) { |
if ($field =~ /$REG{M_fromline}/) { |
212 |
my ($s,undef,$value) = $self->_value_to_arrayitem |
my ($s,undef,$value) = $self->_value_to_arrayitem |
383 |
} |
} |
384 |
} |
} |
385 |
|
|
386 |
|
## Defined for text/rfc822-headers |
387 |
|
sub entity_header ($;$) { |
388 |
|
my $self = shift; |
389 |
|
my $new_header = shift; |
390 |
|
if (ref $new_header) { |
391 |
|
$self->{header} = $new_header; |
392 |
|
} |
393 |
|
$self->{header}; |
394 |
|
} |
395 |
|
|
396 |
=head2 $self->field_name_list () |
=head2 $self->field_name_list () |
397 |
|
|
398 |
Returns list of all C<field-name>s. (Even if there are two |
Returns list of all C<field-name>s. (Even if there are two |