mcorest_api_json_read_start

Start reading JSON data from a stream.

For an overview see page mcorest_api_json_read_*

Prototype

 
    MCO_RET mcorest_api_json_read_start( mcorest_api_stream_t *s, 
                        mcorest_api_json_read_ctx_t *ctx);
 

Arguments

s The mcorest_api_stream_t to read data from
ctx Pointer to the JSON read context structure

Description

This function starts reading JSON data from a stream.

Return Codes

MCO_S_OK = 0 Success
MCO_E_REST_* Any of the Web Services Error Codes

Example

 
    static MCO_RET get_stream_read_json_object(mcohs_request_h req)
    {
        mcorest_api_json_read_ctx_t jctx;
        mcorest_api_stream_t jstream;
        ...
         
        mcorest_api_status_ok(req);
        mcorest_api_stream_with_request(req, &jstream);
        mcorest_api_json_read_start(&jstream, &jctx);
        mcorest_api_json_read_next_token(&jctx, MCOREST_API_JSON_TKN_OBJECT_BGN, NULL);
        ...
        mcorest_api_json_read_finish(&jctx);
        return MCO_S_OK;
    }
     

Files

Header file:
mcorestapi.h
Source file:
jsonrd.c
Library:
libmcorest.a