TYPO3  7.6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Mime_Headers_AbstractHeader Class Reference
Inheritance diagram for Swift_Mime_Headers_AbstractHeader:
Swift_Mime_Header Swift_Mime_Headers_DateHeader Swift_Mime_Headers_IdentificationHeader Swift_Mime_Headers_MailboxHeader Swift_Mime_Headers_PathHeader Swift_Mime_Headers_UnstructuredHeader Swift_Mime_Headers_ParameterizedHeader

Public Member Functions

 __construct (Swift_Mime_Grammar $grammar)
 
 setCharset ($charset)
 
 getCharset ()
 
 setLanguage ($lang)
 
 getLanguage ()
 
 setEncoder (Swift_Mime_HeaderEncoder $encoder)
 
 getEncoder ()
 
 setGrammar (Swift_Mime_Grammar $grammar)
 
 getGrammar ()
 
 getFieldName ()
 
 setMaxLineLength ($lineLength)
 
 getMaxLineLength ()
 
 toString ()
 
 __toString ()
 
- Public Member Functions inherited from Swift_Mime_Header
 getFieldType ()
 
 setFieldBodyModel ($model)
 
 getFieldBodyModel ()
 
 getFieldBody ()
 

Protected Member Functions

 setFieldName ($name)
 
 createPhrase (Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder=null, $shorten=false)
 
 encodeWords (Swift_Mime_Header $header, $input, $usedLength=-1)
 
 tokenNeedsEncoding ($token)
 
 getEncodableWordTokens ($string)
 
 getTokenAsEncodedWord ($token, $firstLineOffset=0)
 
 generateTokenLines ($token)
 
 setCachedValue ($value)
 
 getCachedValue ()
 
 clearCachedValueIf ($condition)
 
 toTokens ($string=null)
 

Private Member Functions

 _tokensToString (array $tokens)
 

Private Attributes

 $_name
 
 $_grammar
 
 $_encoder
 
 $_lineLength = 78
 
 $_lang
 
 $_charset = 'utf-8'
 
 $_cachedValue = null
 

Additional Inherited Members

- Public Attributes inherited from Swift_Mime_Header
const TYPE_TEXT = 2
 
const TYPE_PARAMETERIZED = 6
 
const TYPE_MAILBOX = 8
 
const TYPE_DATE = 16
 
const TYPE_ID = 32
 
const TYPE_PATH = 64
 

Detailed Description

An abstract base MIME Header.

Author
Chris Corbyn

Definition at line 16 of file AbstractHeader.php.

Constructor & Destructor Documentation

__construct ( Swift_Mime_Grammar  $grammar)

Creates a new Header.

Parameters
Swift_Mime_Grammar$grammar

Definition at line 72 of file AbstractHeader.php.

References setGrammar().

Member Function Documentation

__toString ( )

Returns a string representation of this object.

Returns
string
See Also
toString()

Definition at line 217 of file AbstractHeader.php.

References toString().

_tokensToString ( array  $tokens)
private

Takes an array of tokens which appear in the header and turns them into an RFC 2822 compliant string, adding FWSP where needed.

Parameters
string[]$tokens
Returns
string

Definition at line 477 of file AbstractHeader.php.

Referenced by toString().

clearCachedValueIf (   $condition)
protected
createPhrase ( Swift_Mime_Header  $header,
  $string,
  $charset,
Swift_Mime_HeaderEncoder  $encoder = null,
  $shorten = false 
)
protected

Produces a compliant, formatted RFC 2822 'phrase' based on the string given.

Parameters
Swift_Mime_Header$header
string$stringas displayed
string$charsetof the text
Swift_Mime_HeaderEncoder$encoder
bool$shortenthe first line to make remove for header name
Returns
string

Definition at line 245 of file AbstractHeader.php.

References encodeWords(), Swift_Mime_Header\getFieldName(), and getGrammar().

Referenced by Swift_Mime_Headers_MailboxHeader\createDisplayNameString().

encodeWords ( Swift_Mime_Header  $header,
  $input,
  $usedLength = -1 
)
protected

Encode needed word tokens within a string of input.

Parameters
Swift_Mime_Header$header
string$input
string$usedLengthoptional
Returns
string

Definition at line 282 of file AbstractHeader.php.

References getEncodableWordTokens(), Swift_Mime_Header\getFieldName(), getTokenAsEncodedWord(), and tokenNeedsEncoding().

Referenced by createPhrase(), and Swift_Mime_Headers_UnstructuredHeader\getFieldBody().

generateTokenLines (   $token)
protected

Generates tokens from the given string which include CRLF as individual tokens.

Parameters
string$token
Returns
string[]

Definition at line 406 of file AbstractHeader.php.

Referenced by Swift_Mime_Headers_ParameterizedHeader\toTokens(), and toTokens().

getCachedValue ( )
protected
getCharset ( )

Get the character set used in this Header.

Returns
string

Definition at line 96 of file AbstractHeader.php.

References $_charset.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter(), and Swift_Mime_Headers_MailboxHeader\createDisplayNameString().

getEncodableWordTokens (   $string)
protected

Splits a string into tokens in blocks of words which can be encoded quickly.

Parameters
string$string
Returns
string[]

Definition at line 333 of file AbstractHeader.php.

References tokenNeedsEncoding().

Referenced by encodeWords().

getEncoder ( )

Get the encoder used for encoding this Header.

Returns
Swift_Mime_HeaderEncoder

Definition at line 141 of file AbstractHeader.php.

References $_encoder.

Referenced by Swift_Mime_Headers_MailboxHeader\createDisplayNameString().

getFieldName ( )

Get the name of this header (e.g. charset).

Returns
string

Implements Swift_Mime_Header.

Definition at line 172 of file AbstractHeader.php.

References $_name.

getGrammar ( )
getLanguage ( )

Get the language used in this Header.

Returns
string

Definition at line 120 of file AbstractHeader.php.

References $_lang.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter(), and Swift_Mime_Headers_ParameterizedHeader\_getEndOfParameterValue().

getMaxLineLength ( )

Get the maximum permitted length of lines in this Header.

Returns
int

Definition at line 193 of file AbstractHeader.php.

References $_lineLength.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter().

getTokenAsEncodedWord (   $token,
  $firstLineOffset = 0 
)
protected

Get a token as an encoded word for safe insertion into headers.

Parameters
string$tokentoken to encode
int$firstLineOffsetoptional
Returns
string

Definition at line 365 of file AbstractHeader.php.

References $_charset.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter(), and encodeWords().

setCachedValue (   $value)
protected
setCharset (   $charset)

Set the character set used in this Header.

Parameters
string$charset

Implements Swift_Mime_Header.

Definition at line 82 of file AbstractHeader.php.

References clearCachedValueIf().

setEncoder ( Swift_Mime_HeaderEncoder  $encoder)

Set the encoder used for encoding the header.

Parameters
Swift_Mime_HeaderEncoder$encoder

Definition at line 130 of file AbstractHeader.php.

References setCachedValue().

Referenced by Swift_Mime_Headers_MailboxHeader\__construct(), and Swift_Mime_Headers_UnstructuredHeader\__construct().

setFieldName (   $name)
protected
setGrammar ( Swift_Mime_Grammar  $grammar)

Set the grammar used for the header.

Parameters
Swift_Mime_Grammar$grammar

Definition at line 151 of file AbstractHeader.php.

References setCachedValue().

Referenced by __construct().

setLanguage (   $lang)

Set the language used in this Header.

For example, for US English, 'en-us'. This can be unspecified.

Parameters
string$lang

Definition at line 109 of file AbstractHeader.php.

References $lang, and clearCachedValueIf().

setMaxLineLength (   $lineLength)

Set the maximum length of lines in the header (excluding EOL).

Parameters
int$lineLength

Definition at line 182 of file AbstractHeader.php.

References clearCachedValueIf().

tokenNeedsEncoding (   $token)
protected

Test if a token needs to be encoded or not.

Parameters
string$token
Returns
bool

Definition at line 321 of file AbstractHeader.php.

Referenced by encodeWords(), and getEncodableWordTokens().

toString ( )

Get this Header rendered as a RFC 2822 compliant string.

Exceptions
Swift_RfcComplianceException
Returns
string

Implements Swift_Mime_Header.

Definition at line 205 of file AbstractHeader.php.

References _tokensToString(), and toTokens().

Referenced by __toString().

toTokens (   $string = null)
protected

Generate a list of all tokens in the final header.

Parameters
string$stringThe string to tokenize
Returns
array An array of tokens as strings

Definition at line 450 of file AbstractHeader.php.

References generateTokenLines(), and Swift_Mime_Header\getFieldBody().

Referenced by toString().

Member Data Documentation

$_cachedValue = null
private

Definition at line 65 of file AbstractHeader.php.

Referenced by getCachedValue().

$_charset = 'utf-8'
private

Definition at line 58 of file AbstractHeader.php.

Referenced by getCharset(), and getTokenAsEncodedWord().

$_encoder
private

Definition at line 37 of file AbstractHeader.php.

Referenced by getEncoder().

$_grammar
private

Definition at line 30 of file AbstractHeader.php.

Referenced by getGrammar().

$_lang
private

Definition at line 51 of file AbstractHeader.php.

Referenced by getLanguage().

$_lineLength = 78
private

Definition at line 44 of file AbstractHeader.php.

Referenced by getMaxLineLength().

$_name
private

Definition at line 23 of file AbstractHeader.php.

Referenced by getFieldName().