2000-10-26 22:43:56 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
|
|
|
<gsdoc base="GSMimeParser" prev="GSMimeDocument" up="GSMime">
|
|
|
|
<head>
|
|
|
|
<title>GSMimeParser</title>
|
|
|
|
<author name="Richard Frith-Macdonald">
|
|
|
|
<email address="rfm@gnu.org"/>
|
|
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
|
|
</author>
|
2000-11-16 12:10:37 +00:00
|
|
|
<version>0.2</version>
|
|
|
|
<date>16 November, 2000</date>
|
2000-10-26 22:43:56 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
|
|
|
<heading>GSMimeParser</heading>
|
|
|
|
<class name="GSMimeParser" super="NSObject">
|
|
|
|
<declared>Foundation/GSMime.h</declared>
|
|
|
|
<conform>NSObject</conform>
|
|
|
|
<desc>
|
|
|
|
<p>
|
|
|
|
This class provides support for parsing MIME messages
|
|
|
|
into GSMimeDocument objects. It is imtimately related
|
|
|
|
to the GSMimeDocument class and relys on that class for
|
|
|
|
aspects of the parsing operation.
|
|
|
|
</p>
|
|
|
|
</desc>
|
2000-11-16 12:10:37 +00:00
|
|
|
|
2000-10-26 22:43:56 +00:00
|
|
|
<method type="GSMimeParser*" factory="yes">
|
|
|
|
<sel>mimeParser</sel>
|
|
|
|
<desc>
|
|
|
|
Create a parser.
|
|
|
|
</desc>
|
|
|
|
</method>
|
2000-11-16 12:10:37 +00:00
|
|
|
|
|
|
|
<method type="GSMimeDocument*">
|
|
|
|
<sel>document</sel>
|
|
|
|
<desc>
|
|
|
|
Returns the object into which raw mime data is being parsed.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
2000-10-26 22:43:56 +00:00
|
|
|
<method type="BOOL">
|
|
|
|
<sel>parse:</sel>
|
|
|
|
<arg type="NSData*">rawData</arg>
|
|
|
|
<desc>
|
|
|
|
This method is called repeatedly to pass raw mime data into
|
|
|
|
the parser. It should be called with a nil argument at the
|
|
|
|
end of the data - to inform the parser that it has been given
|
|
|
|
all the available information.
|
|
|
|
</desc>
|
|
|
|
</method>
|
2000-11-16 12:10:37 +00:00
|
|
|
|
|
|
|
<method type="BOOL">
|
|
|
|
<sel>parseHeader:</sel>
|
|
|
|
<arg type="NSString*">aRawHeader</arg>
|
2000-10-26 22:43:56 +00:00
|
|
|
<desc>
|
2000-11-16 12:10:37 +00:00
|
|
|
<p>
|
|
|
|
This method is called to parse a header line <em>for the
|
|
|
|
current document</em>, split its contents into an info
|
|
|
|
dictionary, and add that information to the document.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
The standard implementation of this method scans basic
|
|
|
|
information and then calls <code>scanHeaders:named:into:</code>
|
|
|
|
to complete the parsing of the header.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This method also performs consistency checks on headers scanned
|
|
|
|
so it is recommended that it is not overridden, but that
|
|
|
|
subclasses override <code>scanHeaders:named:into:</code> to
|
|
|
|
implement custom scanning.
|
|
|
|
</p>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
2000-10-26 22:43:56 +00:00
|
|
|
<method type="BOOL">
|
|
|
|
<sel>parsingHeaders</sel>
|
|
|
|
<desc>
|
|
|
|
Returns YES if the parser is expecting to read mime headers,
|
|
|
|
Returns NO is the parser has already been passed all the
|
|
|
|
data containing headers, and is now waiting for the body of
|
|
|
|
trhe mime message (or has been passed all data).
|
|
|
|
</desc>
|
|
|
|
</method>
|
2000-11-16 12:10:37 +00:00
|
|
|
|
|
|
|
<method type="BOOL">
|
|
|
|
<sel>scanHeader:</sel>
|
|
|
|
<arg type="NSScanner*">aScanner</arg>
|
|
|
|
<sel>named:</sel>
|
|
|
|
<arg type="NSString*">aName</arg>
|
|
|
|
<sel>inTo:</sel>
|
|
|
|
<arg type="NSMutableDictionary*">info</arg>
|
|
|
|
<desc>
|
|
|
|
<p>
|
|
|
|
This method is called to parse a header line and split its
|
|
|
|
contents into an info dictionary.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
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.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
If the header is parsed successfully, the method should
|
|
|
|
return YES, otherwise NO.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
You should not call this method directly yourself, but may
|
|
|
|
override it to support parsing of new headers.
|
|
|
|
</p>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="NSString*">
|
|
|
|
<sel>scanSpecial:</sel>
|
|
|
|
<arg type="NSScanner*">aScanner</arg>
|
|
|
|
<desc>
|
|
|
|
A convenience method to use a scanner (that is set up to scan a
|
|
|
|
header line) to scan in a special character that terminated a
|
|
|
|
token previously scanned. If the token was terminated by
|
|
|
|
whitespace and no other special character, the string returned
|
|
|
|
will contain a single space character.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="NSString*">
|
|
|
|
<sel>scanToken:</sel>
|
|
|
|
<arg type="NSScanner*">aScanner</arg>
|
|
|
|
<desc>
|
|
|
|
A convenience method to use a scanner (that is set up to scan a
|
|
|
|
header line) to scan a header token - either a quoted string or
|
|
|
|
a simple word.
|
|
|
|
<list>
|
|
|
|
<item>Leading whitespace is ignored.</item>
|
|
|
|
<item>Backslash escapes in quoted text are converted</item>
|
|
|
|
</list>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
2000-10-26 22:43:56 +00:00
|
|
|
</class>
|
|
|
|
</chapter>
|
|
|
|
</body>
|
|
|
|
</gsdoc>
|