diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2008-11-28 17:24:15 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2008-11-28 17:24:15 +0000 |
commit | 1d92c73bc05423872581d513f355783d4864edd5 (patch) | |
tree | 34d869ab24fd4a4deafcc9d24aa276037ed392bb /json-glib/json-node.c | |
parent | 6e7958785096806b3ffa60a4937642d713a051f2 (diff) | |
download | json-glib-1d92c73bc05423872581d513f355783d4864edd5.tar.gz |
Abstract the loading code into its own functionerror-location
The load_from_file() method must set the is_filename/filename fields
of the JsonParserPrivate structure, so that the error handler can
use them to print out the file, as well as the line in case of
error.
Since load_from_data() needs to unset those two fields, to avoid
printing invalid/stale information, we need to have a generic "load"
function that can be invoked by both load_from_data() and
load_from_file(), and leave the JsonParser object set up to those
two methods.
Hence, a private json_parser_load() has been added, moving most of
the code out of json_parser_load_from_data(). This function does not
perform type checks and requires that the length of the memory buffer
containing the JSON data stream is already a positive integer.
Diffstat (limited to 'json-glib/json-node.c')
0 files changed, 0 insertions, 0 deletions