Defines the grammar to use for validation, implements the RFC 2822 (and friends) ABNF grammar definitions.

package Swift
subpackage Mime
author Fabien Potencier
author Chris Corbyn

 Methods

Initialize some RFC 2822 (and friends) ABNF grammar definitions.

__construct() 
access protected

__wakeup()

__wakeup() 

Escape special characters in a string (convert to quoted-pairs).

escapeSpecials(string $token, string[] $include, string[] $exclude) : string

Parameters

$token

string

$include

string[]

additonal chars to escape

$exclude

string[]

chars from escaping

Returns

string

Get the grammar defined for $name token.

getDefinition(string $name) : string

Parameters

$name

string

execatly as written in the RFC

Returns

string

Returns the tokens defined in RFC 2822 (and some related RFCs).

getGrammarDefinitions() : array

Returns

array

Returns the current special characters used in the syntax which need to be escaped.

getSpecials() : array

Returns

array

init()

init() 

 Properties

 

$_grammar : string[]
access private
 

$_specials : string[]
access private