\Swift_Mime_Headers_AbstractHeader
An abstract base MIME Header.
- Author: Chris Corbyn
Synopsis
class Swift_Mime_Headers_AbstractHeader
implements
Swift_Mime_Header
{
- // members
- private string $_name;
- private Swift_Mime_Grammar $_grammar;
- private Swift_Encoder $_encoder;
- private integer $_lineLength;
- private string $_lang;
- private string $_charset;
- private string $_cachedValue;
- // methods
- public void __construct()
- public void setCharset()
- public string getCharset()
- public void setLanguage()
- public string getLanguage()
- public void setEncoder()
- public Swift_Mime_HeaderEncoder getEncoder()
- public void setGrammar()
- public Swift_Mime_Grammar getGrammar()
- public string getFieldName()
- public void setMaxLineLength()
- public int getMaxLineLength()
- public string toString()
- public string __toString()
- protected void setFieldName()
- protected string createPhrase()
- protected string encodeWords()
- protected boolean tokenNeedsEncoding()
- protected array getEncodableWordTokens()
- protected string getTokenAsEncodedWord()
- protected array generateTokenLines()
- protected void setCachedValue()
- protected string getCachedValue()
- protected void clearCachedValueIf()
- protected array toTokens()
- private string _tokensToString()
Hierarchy
Extended by
- Swift_Mime_Headers_MailboxHeader
- Swift_Mime_Headers_DateHeader
- Swift_Mime_Headers_PathHeader
- Swift_Mime_Headers_ParameterizedHeader
- Swift_Mime_Headers_UnstructuredHeader
- Swift_Mime_Headers_IdentificationHeader
Implements
Constants
Name | Value |
---|---|
TYPE_TEXT | 2 |
TYPE_PARAMETERIZED | 6 |
TYPE_MAILBOX | 8 |
TYPE_DATE | 16 |
TYPE_ID | 32 |
TYPE_PATH | 64 |
Members
private
- $_cachedValue
—
string
The value of this Header, cached. - $_charset
—
string
The character set of the text in this Header. - $_encoder
—
Swift_Encoder
The Encoder used to encode this Header. - $_grammar
—
Swift_Mime_Grammar
The Grammar used for this Header. - $_lang
—
string
The language used in this Header. - $_lineLength
—
int
The maximum length of a line in the header. - $_name
—
string
The name of this Header.
Methods
private
- _tokensToString() — Takes an array of tokens which appear in the header and turns them into an RFC 2822 compliant string, adding FWSP where needed.
protected
- clearCachedValueIf() — Clear the cached value if $condition is met.
- createPhrase() — Produces a compliant, formatted RFC 2822 'phrase' based on the string given.
- encodeWords() — Encode needed word tokens within a string of input.
- generateTokenLines() — Generates tokens from the given string which include CRLF as individual tokens.
- getCachedValue() — Get the value in the cache.
- getEncodableWordTokens() — Splits a string into tokens in blocks of words which can be encoded quickly.
- getTokenAsEncodedWord() — Get a token as an encoded word for safe insertion into headers.
- setCachedValue() — Set a value into the cache.
- setFieldName() — Set the name of this Header field.
- toTokens() — Generate a list of all tokens in the final header.
- tokenNeedsEncoding() — Test if a token needs to be encoded or not.
public
- __construct() — Creates a new Header.
- __toString() — Returns a string representation of this object.
- getCharset() — Get the character set used in this Header.
- getEncoder() — Get the encoder used for encoding this Header.
- getFieldName() — Get the name of this header (e.g. charset).
- getGrammar() — Get the grammar used for this Header.
- getLanguage() — Get the language used in this Header.
- getMaxLineLength() — Get the maximum permitted length of lines in this Header.
- setCharset() — Set the character set used in this Header.
- setEncoder() — Set the encoder used for encoding the header.
- setGrammar() — Set the grammar used for the header.
- setLanguage() — Set the language used in this Header.
- setMaxLineLength() — Set the maximum length of lines in the header (excluding EOL).
- toString() — Get this Header rendered as a RFC 2822 compliant string.