ImapTokenizer
class ImapTokenizer (View source)
Properties
| protected int | $position | The current position in the buffer. |
|
| protected string | $buffer | The buffer of characters read from the stream. |
Methods
Skips whitespace characters (spaces and tabs only, preserving CRLF).
Reads a quoted string token.
Reads a literal token.
Reads a number or atom token.
Reads a number token.
Reads an email address token enclosed in angle brackets.
Ensures that at least the given length in characters are available in the buffer.
Returns the current character in the buffer.
Advances the internal pointer by $n characters.
Flush the buffer and reset the position.
Determine if the given character is a valid atom character.
Determine if the given character is a delimiter for tokenizing responses.
Details
__construct(StreamInterface $stream)
Constructor.
Token|null
nextToken()
Returns the next token from the stream.
protected void
skipWhitespace()
Skips whitespace characters (spaces and tabs only, preserving CRLF).
protected QuotedString
readQuotedString()
Reads a quoted string token.
Quoted strings are enclosed in double quotes and may contain escaped characters.
protected Literal
readLiteral()
Reads a literal token.
Literal blocks in IMAP have the form {
protected Token
readNumberOrAtom()
Reads a number or atom token.
protected Number
readNumber()
Reads a number token.
A number consists of one or more digit characters and represents a numeric value.
protected Atom
readAtom()
Reads an atom token.
ATOMs are sequences of printable ASCII characters that do not contain delimiters.
protected EmailAddress|null
readEmailAddress()
Reads an email address token enclosed in angle brackets.
Email addresses are enclosed in angle brackets ("<" and ">").
For example "[email protected]"
protected void
ensureBuffer(int $length)
Ensures that at least the given length in characters are available in the buffer.
protected string|null
currentChar()
Returns the current character in the buffer.
protected void
advance(int $n = 1)
Advances the internal pointer by $n characters.
protected void
flushBuffer()
Flush the buffer and reset the position.
protected bool
isValidAtomCharacter(string $char)
Determine if the given character is a valid atom character.
protected bool
isDelimiter(string $char)
Determine if the given character is a delimiter for tokenizing responses.