summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2008-11-28 17:24:15 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2008-11-28 17:24:15 +0000
commit1d92c73bc05423872581d513f355783d4864edd5 (patch)
tree34d869ab24fd4a4deafcc9d24aa276037ed392bb /json-glib/json-node.c
parent6e7958785096806b3ffa60a4937642d713a051f2 (diff)
downloadjson-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