Parser Interface Reference
Public Member Functions | |
ParserResult | ParseString (string str, out NSError error) |
ParserResult | ParseRawData (NSData rawData, out NSError error) |
bool | SetOptions (NSDictionary options, out NSError error) |
Detailed Description
Defines the interface for a data string parser.
Parsers are capable of parsing one particular data format, which is passed to them during construction.
Member Function Documentation
ParserResult ParseString | ( | string | str, |
out NSError | error | ||
) |
Parses the data string and returns the contained fields in the result object.
In case the result could not be parsed, the error message is accessible as part of the outError parameter.
- Since
- 5.5.0
- Parameters
-
str The string to parse. Must not be nil. error Upon failure will be set to an instance of NSError containing details on why the data could not be parsed. Can be nil.
- Returns
- The result object. Before accessing the fields of the result, you must ensure that the string was correctly parsed, that is, outError has not been set.
ParserResult ParseRawData | ( | NSData | rawData, |
out NSError | error | ||
) |
Parses the raw data of the code and returns the contained fields in the result object.
In case the result could not be parsed, the error message is accessible as part of the outError parameter.
- Since
- 5.5.0
- Parameters
-
rawData The raw data of the string to parse. Must not be nil. error Upon failure will be set to an instance of NSError containing details on why the data could not be parsed. Can be nil.
- Returns
- The result object. Before accessing the fields of the result, you must ensure that the string was correctly parsed, that is, outError has not been set.
bool SetOptions | ( | NSDictionary | options, |
out NSError | error | ||
) |
Set options.
- Since
- 5.5.0
- Parameters
-
options The parser options. error Upon failure, will contain further details.
- Returns
- Returns true on success