Function yaml_parser_set_input_string

Synopsis

#include <include/yaml.h>

void yaml_parser_set_input_string(yaml_parser_t *parser, const unsigned char *input, size_t size)

Description

Set a string input.

Note that the input pointer must be valid while the parser object exists. The application is responsible for destroing input after destroying the parser.

Parameters:

[ in,out ] parser - A parser object.

[ in ] input - A source data.

[ in ] size - The length of the source data in bytes.

Set a string input.

Mentioned in

Source

Lines 288-302 in src/api.c. Line 1347 in include/yaml.h.

YAML_DECLARE(void)
yaml_parser_set_input_string(yaml_parser_t *parser,
        const unsigned char *input, size_t size)
{
    assert(parser); /* Non-NULL parser object expected. */
    assert(!parser->read_handler);  /* You can set the source only once. */
    assert(input);  /* Non-NULL input string expected. */

    parser->read_handler = yaml_string_read_handler;
    parser->read_handler_data = parser;

    parser->input.string.start = input;
    parser->input.string.current = input;
    parser->input.string.end = input+size;
}





Add Discussion as Guest

Log in to DocsForge