SpParser Struct Reference
Public Member Functions | |
SpParser * | sp_parser_new_with_context (ScRecognitionContext *context, SpParserType type, ScContextStatusFlag *status) |
void | sp_parser_free (SpParser *parser) |
SpBool | sp_parser_parse_string (SpParser *parser, char const *str, size_t length, SpParserResult **result) |
SpData | sp_parser_set_options (SpParser *parser, char const *str, size_t length) |
Detailed Description
Parser interface.
Member Function Documentation
SpParser * sp_parser_new_with_context | ( | ScRecognitionContext * | context, |
SpParserType | type, | ||
ScContextStatusFlag * | status | ||
) |
Creates a parser if the license used by the context permits it.
- Parameters
-
context a recognition context. Must not be null. type type of the parser status indicates errors during instantiation. Check this flag if the returned parser is a null pointer. Also, see sc_context_status_flag_get_message and ScContextStatusFlag for more information about status flags.
- Returns
- a parser object or null if the license does not include the parser
void sp_parser_free | ( | SpParser * | parser | ) |
Free the parser and associated resources.
- Parameters
-
parser The parser to free. May be null
SpBool sp_parser_parse_string | ( | SpParser * | parser, |
char const * | str, | ||
size_t | length, | ||
SpParserResult ** | result | ||
) |
parse the data contained in the given string
- Parameters
-
parser The parser object. Must not be null. str input string. Must not be null. length length of the input string result ouput parameter. Needs to be freed by the caller.
- Returns
- True on success, false if the data could not be parsed for some reason. In case of error, more details on why the parsing failed can be obtained by calling sp_parse_result_get_error_message.
Sets the options contained in the given json string.
- Parameters
-
parser The parser object. Must not be null. str options string. Must not be null. length length of the options string
- Returns
- the error message. If there were no errors, a NULL string is returned. The life-time of the string is not bound to the life-time of the parser object. The user has to free the SpData structure using sp_data_free.
The documentation for this struct was generated from the following file: