| 1 |
wakaba |
1.1 |
|
| 2 |
|
|
=head1 NAME
|
| 3 |
|
|
|
| 4 |
|
|
Message::Body::ApplicationOctetStream --- Perl module
|
| 5 |
|
|
for "application/octet-stream" Internet Media Type
|
| 6 |
|
|
|
| 7 |
|
|
=cut
|
| 8 |
|
|
|
| 9 |
|
|
package Message::Body::ApplicationOctetStream;
|
| 10 |
|
|
use strict;
|
| 11 |
|
|
use vars qw(%DEFAULT @ISA $VERSION);
|
| 12 |
|
|
$VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
|
| 13 |
|
|
|
| 14 |
|
|
require Message::Body::Text;
|
| 15 |
|
|
push @ISA, qw(Message::Body::Text);
|
| 16 |
|
|
|
| 17 |
|
|
%DEFAULT = (
|
| 18 |
|
|
-_METHODS => [qw|value|],
|
| 19 |
|
|
-_MEMBERS => [qw||],
|
| 20 |
|
|
-media_type => 'application',
|
| 21 |
|
|
-media_subtype => 'octet-stream',
|
| 22 |
|
|
-parse_all => 0,
|
| 23 |
|
|
#use_normalization => 0,
|
| 24 |
|
|
#use_param_charset => 0,
|
| 25 |
|
|
);
|
| 26 |
|
|
|
| 27 |
|
|
=head1 CONSTRUCTORS
|
| 28 |
|
|
|
| 29 |
|
|
The following methods construct new C<Message::Field::Structured> objects:
|
| 30 |
|
|
|
| 31 |
|
|
=over 4
|
| 32 |
|
|
|
| 33 |
|
|
=cut
|
| 34 |
|
|
|
| 35 |
|
|
## Initialize of this class -- called by constructors
|
| 36 |
|
|
sub _init ($;%) {
|
| 37 |
|
|
my $self = shift;
|
| 38 |
|
|
my $DEFAULT = Message::Util::make_clone (\%DEFAULT);
|
| 39 |
|
|
my %option = @_;
|
| 40 |
|
|
$self->SUPER::_init (%$DEFAULT, %option);
|
| 41 |
|
|
}
|
| 42 |
|
|
|
| 43 |
|
|
=item $body = Message::Body::TextPlain->new ([%options])
|
| 44 |
|
|
|
| 45 |
|
|
Constructs a new object. You might pass some options as parameters
|
| 46 |
|
|
to the constructor.
|
| 47 |
|
|
|
| 48 |
|
|
=cut
|
| 49 |
|
|
|
| 50 |
|
|
## Inherited
|
| 51 |
|
|
|
| 52 |
|
|
=item $body = Message::Body::TextPlain->parse ($body, [%options])
|
| 53 |
|
|
|
| 54 |
|
|
Constructs a new object with given field body. You might pass
|
| 55 |
|
|
some options as parameters to the constructor.
|
| 56 |
|
|
|
| 57 |
|
|
=cut
|
| 58 |
|
|
|
| 59 |
|
|
sub parse ($$;%) {
|
| 60 |
|
|
my $class = shift;
|
| 61 |
|
|
my $self = bless {}, $class;
|
| 62 |
|
|
my $body = shift;
|
| 63 |
|
|
$self->_init (@_);
|
| 64 |
|
|
$self->{value} = $body;
|
| 65 |
|
|
$self;
|
| 66 |
|
|
}
|
| 67 |
|
|
|
| 68 |
|
|
=back
|
| 69 |
|
|
|
| 70 |
|
|
=cut
|
| 71 |
|
|
|
| 72 |
|
|
## header: Inherited
|
| 73 |
|
|
## value: Inherited
|
| 74 |
|
|
|
| 75 |
|
|
=head2 $self->stringify ([%option])
|
| 76 |
|
|
|
| 77 |
|
|
Returns the C<body> as a string.
|
| 78 |
|
|
|
| 79 |
|
|
=cut
|
| 80 |
|
|
|
| 81 |
|
|
sub stringify ($;%) {
|
| 82 |
|
|
my $self = shift;
|
| 83 |
|
|
my %o = @_; my %option = %{$self->{option}};
|
| 84 |
|
|
for (grep {/^-/} keys %o) {$option{substr ($_, 1)} = $o{$_}}
|
| 85 |
|
|
$self->{value};
|
| 86 |
|
|
}
|
| 87 |
|
|
*as_string = \&stringify;
|
| 88 |
|
|
|
| 89 |
|
|
## Inherited: option, clone
|
| 90 |
|
|
|
| 91 |
|
|
=head1 SEE ALSO
|
| 92 |
|
|
|
| 93 |
|
|
RFC 2046 <urn:ietf:rfc:2046>
|
| 94 |
|
|
|
| 95 |
|
|
=head1 LICENSE
|
| 96 |
|
|
|
| 97 |
|
|
Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.
|
| 98 |
|
|
|
| 99 |
|
|
This program is free software; you can redistribute it and/or modify
|
| 100 |
|
|
it under the terms of the GNU General Public License as published by
|
| 101 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
| 102 |
|
|
(at your option) any later version.
|
| 103 |
|
|
|
| 104 |
|
|
This program is distributed in the hope that it will be useful,
|
| 105 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 106 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 107 |
|
|
GNU General Public License for more details.
|
| 108 |
|
|
|
| 109 |
|
|
You should have received a copy of the GNU General Public License
|
| 110 |
|
|
along with this program; see the file COPYING. If not, write to
|
| 111 |
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
| 112 |
|
|
Boston, MA 02111-1307, USA.
|
| 113 |
|
|
|
| 114 |
|
|
=head1 CHANGE
|
| 115 |
|
|
|
| 116 |
|
|
See F<ChangeLog>.
|
| 117 |
|
|
$Date: 2002/03/13 15:10:21 $
|
| 118 |
|
|
|
| 119 |
|
|
=cut
|
| 120 |
|
|
|
| 121 |
|
|
1;
|