Copied!

Holds generic/all purpose information about a part while it's being parsed.

The class holds:

  • a HeaderContainer to hold headers
  • stream positions (part start/end positions, content start/end)
  • the message's psr7 stream and a resource handle created from it (held
    only for a top-level PartBuilder representing the message, child
    PartBuilders do not duplicate/hold a separate stream).

More specific information a parser needs to keep about a message as it's
parsing it should be stored in its ParserPartProxy.

CloneableInstantiable
Methods
public __construct(ZBateson\MailMimeParser\Message\PartHeaderContainer $headerContainer, ?Psr\Http\Message\StreamInterface $messageStream = NULL, ?ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy $parent = NULL)
public __destruct()
public getHeaderContainer()
 

Returns this part's PartHeaderContainer.

public getMessageResourceHandle()
 

Returns the resource handle for a the message's stream, getting it from
the parent part if this is a child part.

public getMessageResourceHandlePos()
 

Shortcut for calling ftell($partBuilder->getMessageResourceHandle()).

public getParent()
 

The ParserPartProxy parent of this PartBuilder.

public getStream()
 

Returns the raw message StreamInterface for a message, getting it from
the parent part if this is a child part.

public getStreamContentLength()
 

Returns the length of this part's content stream.

This method does not perform checks on whether the start pos and end pos
of this part's content have been set, and so could cause errors if called
before being set and are still null.

public getStreamContentStartPos()
 

Returns the byte offset start position of the content of this part within
the main raw message stream, or null if not set.

public getStreamPartLength()
 

Returns the number of raw bytes this part has.

This method does not perform checks on whether the start pos and end pos
of this part have been set, and so could cause errors if called before
being set and are still null.

public getStreamPartStartPos()
 

Returns the byte offset start position for this part within the message
stream if it's been set, or null otherwise.

public isContentParsed()
 

Returns true if the byte offset positions for this part's content have
been set.

public isMime()
 

Returns true if this part, or any parent, have a Content-Type or
MIME-Version header set.

public setStreamContentStartPos( $streamContentStartPos)
 

Sets the byte offset start position of the content in the raw message
stream.

public setStreamPartAndContentEndPos( $streamContentEndPos)
 

Sets the byte offset end position of the content and part in the raw
message stream.

public setStreamPartEndPos( $streamPartEndPos)
 

Sets the byte offset end position of the part in the raw message stream,
and also calls its parent's setParentStreamPartEndPos to expand to parent
PartBuilders.

public setStreamPartStartPos( $streamPartStartPos)
 

Sets the byte offset start position of the part in the raw message
stream.

Properties
private $headerContainer
 
private $messageHandle
 
private $messageStream
 
private $parent
 
private $streamContentEndPos
 
private $streamContentStartPos
 
private $streamPartEndPos
 
private $streamPartStartPos
 
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration