Abstract Class Swift_Mime_Headers_AbstractHeader

InheritanceSwift_Mime_Headers_AbstractHeader
ImplementsSwift_Mime_Header
SubclassesSwift_Mime_Headers_DateHeader, Swift_Mime_Headers_IdentificationHeader, Swift_Mime_Headers_MailboxHeader, Swift_Mime_Headers_ParameterizedHeader, Swift_Mime_Headers_PathHeader, Swift_Mime_Headers_UnstructuredHeader

An abstract base MIME Header.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Creates a new Header. Swift_Mime_Headers_AbstractHeader
__toString() Returns a string representation of this object. Swift_Mime_Headers_AbstractHeader
getCharset() Get the character set used in this Header. Swift_Mime_Headers_AbstractHeader
getEncoder() Get the encoder used for encoding this Header. Swift_Mime_Headers_AbstractHeader
getFieldBody() Get the field body, prepared for folding into a final header value. Swift_Mime_Header
getFieldBodyModel() Get the model for the field body. Swift_Mime_Header
getFieldName() Get the name of this header (e.g. charset). Swift_Mime_Headers_AbstractHeader
getFieldType() Get the type of Header that this instance represents. Swift_Mime_Header
getGrammar() Get the grammar used for this Header. Swift_Mime_Headers_AbstractHeader
getLanguage() Get the language used in this Header. Swift_Mime_Headers_AbstractHeader
getMaxLineLength() Get the maximum permitted length of lines in this Header. Swift_Mime_Headers_AbstractHeader
setCharset() Set the character set used in this Header. Swift_Mime_Headers_AbstractHeader
setEncoder() Set the encoder used for encoding the header. Swift_Mime_Headers_AbstractHeader
setFieldBodyModel() Set the model for the field body. Swift_Mime_Header
setGrammar() Set the grammar used for the header. Swift_Mime_Headers_AbstractHeader
setLanguage() Set the language used in this Header. Swift_Mime_Headers_AbstractHeader
setMaxLineLength() Set the maximum length of lines in the header (excluding EOL). Swift_Mime_Headers_AbstractHeader
toString() Get this Header rendered as a RFC 2822 compliant string. Swift_Mime_Headers_AbstractHeader

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
clearCachedValueIf() Clear the cached value if $condition is met. Swift_Mime_Headers_AbstractHeader
createPhrase() Produces a compliant, formatted RFC 2822 'phrase' based on the string given. Swift_Mime_Headers_AbstractHeader
encodeWords() Encode needed word tokens within a string of input. Swift_Mime_Headers_AbstractHeader
generateTokenLines() Generates tokens from the given string which include CRLF as individual tokens. Swift_Mime_Headers_AbstractHeader
getCachedValue() Get the value in the cache. Swift_Mime_Headers_AbstractHeader
getEncodableWordTokens() Splits a string into tokens in blocks of words which can be encoded quickly. Swift_Mime_Headers_AbstractHeader
getTokenAsEncodedWord() Get a token as an encoded word for safe insertion into headers. Swift_Mime_Headers_AbstractHeader
setCachedValue() Set a value into the cache. Swift_Mime_Headers_AbstractHeader
setFieldName() Set the name of this Header field. Swift_Mime_Headers_AbstractHeader
toTokens() Generate a list of all tokens in the final header. Swift_Mime_Headers_AbstractHeader
tokenNeedsEncoding() Test if a token needs to be encoded or not. Swift_Mime_Headers_AbstractHeader

Method Details

__construct() public method

Creates a new Header.

public void __construct ( Swift_Mime_Grammar $grammar )
$grammar Swift_Mime_Grammar
__toString() public method

Returns a string representation of this object.

See also toString().

public string __toString ( )
clearCachedValueIf() protected method

Clear the cached value if $condition is met.

protected void clearCachedValueIf ( $condition )
$condition bool
createPhrase() protected method

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

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

As displayed

$charset string

Of the text

$encoder Swift_Mime_HeaderEncoder
$shorten bool

The first line to make remove for header name

encodeWords() protected method

Encode needed word tokens within a string of input.

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

Optional

generateTokenLines() protected method

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

protected string[] generateTokenLines ( $token )
$token string
getCachedValue() protected method

Get the value in the cache.

protected string getCachedValue ( )
getCharset() public method

Get the character set used in this Header.

public string getCharset ( )
getEncodableWordTokens() protected method

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

protected string[] getEncodableWordTokens ( $string )
$string string
getEncoder() public method

Get the encoder used for encoding this Header.

public Swift_Mime_HeaderEncoder getEncoder ( )
getFieldName() public method

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

public string getFieldName ( )
getGrammar() public method

Get the grammar used for this Header.

public Swift_Mime_Grammar getGrammar ( )
getLanguage() public method

Get the language used in this Header.

public string getLanguage ( )
getMaxLineLength() public method

Get the maximum permitted length of lines in this Header.

public int getMaxLineLength ( )
getTokenAsEncodedWord() protected method

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

protected string getTokenAsEncodedWord ( $token, $firstLineOffset 0 )
$token string

Token to encode

$firstLineOffset int

Optional

setCachedValue() protected method

Set a value into the cache.

protected void setCachedValue ( $value )
$value string
setCharset() public method

Set the character set used in this Header.

public void setCharset ( $charset )
$charset string
setEncoder() public method

Set the encoder used for encoding the header.

public void setEncoder ( Swift_Mime_HeaderEncoder $encoder )
$encoder Swift_Mime_HeaderEncoder
setFieldName() protected method

Set the name of this Header field.

protected void setFieldName ( $name )
$name string
setGrammar() public method

Set the grammar used for the header.

public void setGrammar ( Swift_Mime_Grammar $grammar )
$grammar Swift_Mime_Grammar
setLanguage() public method

Set the language used in this Header.

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

public void setLanguage ( $lang )
$lang string
setMaxLineLength() public method

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

public void setMaxLineLength ( $lineLength )
$lineLength int
toString() public method

Get this Header rendered as a RFC 2822 compliant string.

public string toString ( )
throws Swift_RfcComplianceException
toTokens() protected method

Generate a list of all tokens in the final header.

protected array toTokens ( $string null )
$string string

The string to tokenize

return array

An array of tokens as strings

tokenNeedsEncoding() protected method

Test if a token needs to be encoded or not.

protected bool tokenNeedsEncoding ( $token )
$token string