A bi-directional parser-to-part proxy for MimeParser and IMimeParts.
- author Zaahid Bateson
Methods |
public getAddedChildAt(int $index) : ?ZBateson Returns the added child at the provided index, useful for looking at previously parsed children. |
public getContentType() : ?ZBateson Returns a ParameterHeader representing the parsed Content-Type header for this part. |
public getLastAddedChild() : ?ZBateson Returns the last part that was added. |
public getLastLineEndingLength() : int Returns the length of the last line ending read by MimeParser (e.g. 2 for '\r\n', or 1 for '\n'). The line ending may not belong specifically to this part, so ParserMimePartProxy simply calls getLastLineEndingLength on its parent, which must eventually reach a ParserMessageProxy which actually keeps the length and returns it.
|
public getMimeBoundary() : ?string Returns the parsed boundary parameter of the Content-Type header if set for a multipart message part. |
public isEndBoundaryFound() : bool Returns true if an end boundary was found for this part. |
public isParentBoundaryFound() : bool Returns true if the parser passed an input line to setEndBoundary that matches a parent's mime boundary, and the following input belongs to a new part under its parent. |
public parseAll() : static Parses all content and children for this part. |
public popNextChild() : ?ZBateson Returns the next child part if one exists, popping it from the internal 'stack' of children, attempting to parse a new one if the stack is empty, and returning null if there are no more children.
|
public setEndBoundaryFound(string $line) : bool Returns true if the passed $line of read input matches this part's mime boundary, or any of its parent's mime boundaries for a multipart message. If the passed $line is the ending boundary for the current part, $this->isEndBoundaryFound will return true after. |
public setEof() : static Called once EOF is reached while reading content. The method sets the flag used by isParentBoundaryFound() to true on this part and all parent parts. |
public setLastLineEndingLength(int $length) : static Sets the length of the last line ending read by MimeParser (e.g. 2 for '\r\n', or 1 for '\n'). The line ending may not belong specifically to this part, so ParserMimePartProxy simply calls setLastLineEndingLength on its parent, which must eventually reach a ParserMessageProxy which actually stores the length. |
public setStreamPartAndContentEndPos(int $streamContentEndPos) : static Overridden to set a 0-length content length, and a stream end pos of -2 if the passed end pos is before the start pos (can happen if a mime end boundary doesn't have an empty line before the next parent start boundary). |
Properties |
protected bool $allChildrenParsed = false
|
protected array $children = []
|
protected array $childrenStack = []
|
protected bool $endBoundaryFound = false
|
protected ?ZBateson
|
protected bool $parentBoundaryFound = false
|
Methods |
protected ensureLastChildParsed() : static Ensures that the last child added to this part is fully parsed (content and children). |
protected parseNextChild() : static Parses the next child of this part and adds it to the 'stack' of children. |
Properties |
private ?string $mimeBoundary = NULL
|
private bool $mimeBoundaryQueried = false
|