
=head1 NAME

Mail::Message::Field::Flex - one line of a message header

=head1 CLASS INHERITANCE

 Mail::Message::Field::Flex
   is a Mail::Message::Field
   is a Mail::Reporter

=head1 SYNOPSIS


=head1 DESCRIPTION

This is the flexible implementation of
a field: it can easily be extended because it stores its data in a hash
and the constructor (C<new>) and initializer (C<init>) are split.  However,
you pay the price in performance.
Mail::Message::Field::Fast is faster (as the name predicts).

=head1 METHODS

=head2 Initiation

=over 4

=item B<new> DATA

(Class method) 
If you stick to this flexible class of header fields, you have a bit
more facilities than with Mail::Message::Field::Fast.  Amongst it, you
can specify options with the creation.  Possible arguments:

=over 4

=item * B<new> LINE

=item * B<new> NAME, (BODY|OBJECTS), [ATTRIBUTES], [OPTIONS]

=back

To be able to distinguish the different parameters, you will have
to specify the OPTIONS as ARRAY of option pairs, or HASH of options.
The ATTRIBUTES are a flat list of key-value pairs.  The body is
specified as one BODY string, one OBJECT, or a reference to an array
of OBJECTS.  See Mail::Message::Field:

 OPTION               DEFAULT
 attributes           []
 comment              undef
 log                  'WARNINGS'
 trace                'WARNINGS'

=over 4

=item B<attributes> =E<gt> ATTRS

Reference to array with list of key-value pairs representing attributes,
or reference to a hash containing these pairs.  This is an alternative
notation for specifying ATTRIBUTES directly as method arguments.

=item B<comment> =E<gt> STRING

A pre-formatted list of attributes.

=item B<log> =E<gt> LEVEL

See Mail::Reporter::new(log)

=item B<trace> =E<gt> LEVEL

See Mail::Reporter::new(trace)

=back

=back

=head2 The Field

=over 4

=item B<clone> 

See Mail::Message::Field::clone()

=item B<isStructured> 

See Mail::Message::Field::isStructured()

=item B<length> 

See Mail::Message::Field::length()

=back

=head2 Access to the Field

=over 4

=item B<Name> 

See Mail::Message::Field::Name()

=item B<addresses> 

See Mail::Message::Field::addresses()

=item B<attribute> NAME [, VALUE]

See Mail::Message::Field::attribute()

=item B<body> 

See Mail::Message::Field::body()

=item B<comment> [STRING]

See Mail::Message::Field::comment()

=item B<dateToTimestamp> STRING

See Mail::Message::Field::dateToTimestamp()

=item B<folded> 

See Mail::Message::Field::folded()

=item B<foldedBody> [BODY]

See Mail::Message::Field::foldedBody()

=item B<name> 

See Mail::Message::Field::name()

=item B<nrLines> 

See Mail::Message::Field::nrLines()

=item B<print> [FILEHANDLE]

See Mail::Message::Field::print()

=item B<size> 

See Mail::Message::Field::size()

=item B<string> [WRAP]

See Mail::Message::Field::string()

=item B<stripCFWS> [STRING]

See Mail::Message::Field::stripCFWS()

=item B<toDate> [TIME]

See Mail::Message::Field::toDate()

=item B<toDisclose> 

See Mail::Message::Field::toDisclose()

=item B<toInt> 

See Mail::Message::Field::toInt()

=item B<unfoldedBody> [BODY, [WRAP]]

See Mail::Message::Field::unfoldedBody()

=item B<wellformedName> [STRING]

See Mail::Message::Field::wellformedName()

=back

=head2 Reading and Writing [internals]

=over 4

=item B<consume> LINE | (NAME,BODY|OBJECTS)

See Mail::Message::Field::consume()

=item B<defaultWrapLength> [LENGTH]

See Mail::Message::Field::defaultWrapLength()

=item B<fold> NAME, BODY, [MAXCHARS]

See Mail::Message::Field::fold()

=item B<setWrapLength> [LENGTH]

See Mail::Message::Field::setWrapLength()

=item B<unfold> STRING

See Mail::Message::Field::unfold()

=back

=head2 Logging and Tracing

=over 4

=item B<defaultTrace> [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

=item B<errors> 

See Mail::Reporter::errors()

=item B<log> [LEVEL [,STRINGS]]

See Mail::Reporter::log()

=item B<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

=item B<trace> [LEVEL]

See Mail::Reporter::trace()

=item B<warnings> 

See Mail::Reporter::warnings()

=back

=head2 Other Methods

=over 4

=item B<AUTOLOAD> 

See Mail::Reporter::AUTOLOAD()

=item B<DESTROY> 

See Mail::Reporter::DESTROY()

=item B<inGlobalDestruction> 

See Mail::Reporter::inGlobalDestruction()

=item B<logPriority> LEVEL

See Mail::Reporter::logPriority()

=item B<logSettings> 

See Mail::Reporter::logSettings()

=item B<notImplemented> 

See Mail::Reporter::notImplemented()

=back

=head1 SEE ALSO

A good start to read is Mail::Box-Overview.
More documentation and a mailinglist are available from the project's
website at L<http://perl.overmeer.net/mailbox/>.

=head1 AUTHOR

Written by Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>)
with the help of many.  See the ChangeLog for details.

=head1 VERSION

This code is beta, version 2.037.

Copyright (c) 2001-2003 by the authors. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
