TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Swift_Encoder_QpEncoder Class Reference
Inheritance diagram for Swift_Encoder_QpEncoder:
Swift_Encoder Swift_Mime_CharsetObserver Swift_Mime_ContentEncoder_QpContentEncoder Swift_Mime_HeaderEncoder_QpHeaderEncoder

Public Member Functions

 __construct (Swift_CharacterStream $charStream, Swift_StreamFilter $filter=null)
 
 __sleep ()
 
 __wakeup ()
 
 encodeString ($string, $firstLineOffset=0, $maxLineLength=0)
 
 charsetChanged ($charset)
 
 __clone ()
 

Protected Member Functions

 getSafeMapShareId ()
 
 initSafeMap ()
 
 _encodeByteSequence (array $bytes, &$size)
 
 _nextSequence ($size=4)
 
 _standardize ($string)
 

Protected Attributes

 $_charStream
 
 $_filter
 
 $_safeMap = array()
 

Static Protected Attributes

static $_qpMap
 
static $_safeMapShare = array()
 

Detailed Description

Handles Quoted Printable (QP) Encoding in Swift Mailer.

Possibly the most accurate RFC 2045 QP implementation found in PHP.

Author
Chris Corbyn

Definition at line 18 of file QpEncoder.php.

Constructor & Destructor Documentation

__construct ( Swift_CharacterStream  $charStream,
Swift_StreamFilter  $filter = null 
)

Creates a new QpEncoder for the given CharacterStream.

Parameters
Swift_CharacterStream$charStreamto use for reading characters
Swift_StreamFilter$filterif input should be canonicalized

Definition at line 109 of file QpEncoder.php.

References $_safeMap, getSafeMapShareId(), and initSafeMap().

Member Function Documentation

__clone ( )

Make a deep copy of object.

Definition at line 285 of file QpEncoder.php.

References $_charStream.

__sleep ( )

Definition at line 121 of file QpEncoder.php.

__wakeup ( )

Definition at line 126 of file QpEncoder.php.

References $_safeMap, getSafeMapShareId(), and initSafeMap().

_encodeByteSequence ( array  $bytes,
$size 
)
protected

Encode the given byte array into a verbatim QP form.

Parameters
integer[]$bytes
int$size
Returns
string

Definition at line 232 of file QpEncoder.php.

Referenced by Swift_Mime_ContentEncoder_QpContentEncoder\encodeByteStream(), and encodeString().

_nextSequence (   $size = 4)
protected

Get the next sequence of bytes to read from the char stream.

Parameters
int$sizenumber of bytes to read
Returns
integer[]

Definition at line 256 of file QpEncoder.php.

Referenced by Swift_Mime_ContentEncoder_QpContentEncoder\encodeByteStream(), and encodeString().

_standardize (   $string)
protected

Make sure CRLF is correct and HT/SPACE are in valid places.

Parameters
string$string
Returns
string

Definition at line 268 of file QpEncoder.php.

Referenced by encodeString().

charsetChanged (   $charset)

Updates the charset used.

Parameters
string$charset

Implements Swift_Mime_CharsetObserver.

Definition at line 219 of file QpEncoder.php.

encodeString (   $string,
  $firstLineOffset = 0,
  $maxLineLength = 0 
)

Takes an unencoded string and produces a QP encoded string from it.

QP encoded strings have a maximum line length of 76 characters. If the first line needs to be shorter, indicate the difference with $firstLineOffset.

Parameters
string$stringto encode
int$firstLineOffset,optional
int$maxLineLength,optional0 indicates the default of 76 chars
Returns
string

Implements Swift_Encoder.

Definition at line 162 of file QpEncoder.php.

References _encodeByteSequence(), _nextSequence(), and _standardize().

getSafeMapShareId ( )
protected

Definition at line 136 of file QpEncoder.php.

Referenced by __construct(), and __wakeup().

initSafeMap ( )
protected

Definition at line 141 of file QpEncoder.php.

Referenced by __construct(), and __wakeup().

Member Data Documentation

$_charStream
protected

Definition at line 25 of file QpEncoder.php.

Referenced by __clone().

$_filter
protected

Definition at line 32 of file QpEncoder.php.

$_qpMap
staticprotected

Definition at line 39 of file QpEncoder.php.

$_safeMap = array()
protected

Definition at line 101 of file QpEncoder.php.

Referenced by __construct(), and __wakeup().

$_safeMapShare = array()
staticprotected

Definition at line 94 of file QpEncoder.php.