Abstract the loading code into its own function
Abstract the loading code into its own function

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.

oerdnj/json-glib,robtaylor/json-glib-gvariant,oerdnj/json-glib,ebassi/json-glib,ebassi/json-glib,Distrotech/json-glib,robtaylor/json-glib-gvariant,oerdnj/json-glib,frida/json-glib,GNOME/json-glib,Distrotech/json-glib,Distrotech/json-glib,brauliobo/json-glib,frida/json-glib,ebassi/json-glib,brauliobo/json-glib,brauliobo/json-glib,GNOME/json-glib,oerdnj/json-glib