This class provides support for parsing MIME messages into GSMimeDocument objects. Each parser object maintains an associated document into which data is stored.
The default implementation supports the following transfer
encodings specified in either a transfer-encoding
of content-transfer-encoding
header -
Decodes the raw data from the specified range in the source data object and appends it to the destination data object. The context object provides information about the content encoding type in use, and the state of the decoding operation.
This method may be called repeatedly to incrementally decode information as it arrives on some communications channel. It should be called with a nil source data item (or with the atEnd flag of the context set to YES) in order to flush any information held in the context to the output data object.
You may override this method in order to implement additional coding schemes.
This method is called to parse a header line for the current document, split its contents into an info dictionary, and add that information to the document.
The standard implementation of this method scans basic
information and then calls scanHeaders:named:into:
to complete the parsing of the header.
This method also performs consistency checks on headers scanned
so it is recommended that it is not overridden, but that
subclasses override scanHeaders:named:into:
to
implement custom scanning.
As a special case, for HTTP support, this method also parses
lines in the format of HTTP responses as if they were headers
named http
. The resulting header info dictionary
contains -
This method is called to parse a header line and split its contents into an info dictionary.
On entry, the dictionary is already partially filled, the name argument is a lowercase representation of the header name, and the scanner is set to a scan location immediately after the colon in the header string.
If the header is parsed successfully, the method should return YES, otherwise NO.
You should not call this method directly yourself, but may override it to support parsing of new headers.
You should be aware of the parsing that the standard implementation performs, and that needs to be done for certain headers in order to permit the parser to work generally -