Class Horde_Text_Flowed
The Text_Flowed:: class provides common methods for manipulating text
using the encoding described in RFC 3676 ('flowed' text).
This class is based on the Text::Flowed perl module (Version 0.14) found
in the CPAN perl repository. This module is released under the Perl
license, which is compatible with the LGPL.
Copyright 2002-2003 Philip Mak
Copyright 2004-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
|
#
__construct( string $text, string $charset = 'UTF-8' )
Constructor.
Parameters
- $text
- The text to process.
- $charset
- The character set of $text.
|
public
|
#
setMaxLength( integer $max )
Set the maximum length of a line of text.
Set the maximum length of a line of text.
Parameters
- $max
- A new value for $_maxlength.
|
public
|
#
setOptLength( integer $opt )
Set the optimal length of a line of text.
Set the optimal length of a line of text.
Parameters
- $opt
- $max A new value for $_optlength.
|
public
|
#
setDelSp( boolean $delsp )
Set whether to format text using DelSp.
Set whether to format text using DelSp.
Parameters
|
public
string
|
#
toFixed( boolean $quote = false )
Reformats the input string, where the string is 'format=flowed' plain
text as described in RFC 2646.
Reformats the input string, where the string is 'format=flowed' plain
text as described in RFC 2646.
Parameters
- $quote
- Add level of quoting to each line?
Returns
string The text converted to RFC 2646 'fixed' format.
|
public
array
|
#
toFixedArray( boolean $quote = false )
Reformats the input string, and returns the output in an array format
with quote level information.
Reformats the input string, and returns the output in an array format
with quote level information.
Parameters
- $quote
- Add level of quoting to each line?
Returns
array An array of arrays with the following elements:
'level' - The quote level of the current line.
'text' - The text for the current line.
|
public
string
|
#
toFlowed( boolean $quote = false, array $opts = array() )
Reformats the input string, where the string is 'format=fixed' plain
text as described in RFC 2646.
Reformats the input string, where the string is 'format=fixed' plain
text as described in RFC 2646.
Parameters
- $quote
- Add level of quoting to each line?
- $opts
- Additional options:
<pre><span class="php-quote">'nowrap'</span> - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, does not wrap unquoted lines.
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span></pre>
Returns
string The text converted to RFC 2646 'flowed' format.
|