uzuki2
Recovering R lists faithfully from HDF5 or JSON
|
Parse an R list from a JSON file. More...
Classes | |
struct | Options |
Options for JSON file parsing. More... | |
Parse an R list from a JSON file.
JSON provides an alternative to the HDF5 format handled by hdf5::parse()
and friends. JSON is simpler to parse and has less formatting-related overhead. However, it does not support random access and discards some precision for floating-point numbers.
ParsedList uzuki2::json::parse | ( | byteme::Reader & | reader, |
Externals | ext, | ||
Options | options = Options() |
||
) |
Parse JSON file contents using the uzuki2 specification, given an arbitrary input source of bytes.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
Externals | Class describing how to resolve external references for type EXTERNAL . See hdf5::parse() for more details. |
reader | Instance of a byteme::Reader providing the contents of the JSON file. |
ext | Instance of an external reference resolver class. |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
ParsedList uzuki2::json::parse | ( | byteme::Reader & | reader, |
Options | options = Options() |
||
) |
Overload of json::parse()
assuming that there are no external references.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
reader | Instance of a byteme::Reader providing the contents of the JSON file. |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
ParsedList uzuki2::json::parse_buffer | ( | const unsigned char * | buffer, |
size_t | len, | ||
Externals | ext, | ||
Options | options = Options() |
||
) |
Parse a buffer containing JSON file contents using the uzuki2 specification.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
Externals | Class describing how to resolve external references for type EXTERNAL . See hdf5::parse() for more details. |
[in] | buffer | Pointer to an array containing the JSON file contents (possibly Gzip/Zlib-compressed). |
len | Length of the buffer in bytes. | |
ext | Instance of an external reference resolver class. | |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
ParsedList uzuki2::json::parse_buffer | ( | const unsigned char * | buffer, |
size_t | len, | ||
Options | options = Options() |
||
) |
Overload of json::parse_buffer()
assuming that there are no external references.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
[in] | buffer | Pointer to an array containing the JSON file contents (possibly Gzip/Zlib-compressed). |
len | Length of the buffer in bytes. | |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
ParsedList uzuki2::json::parse_file | ( | const std::string & | file, |
Externals | ext, | ||
Options | options = Options() |
||
) |
Parse JSON file contents using the uzuki2 specification, given the file path.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
Externals | Class describing how to resolve external references for type EXTERNAL . See hdf5::parse() for more details. |
file | Path to a (possibly Gzip-compressed) JSON file. |
ext | Instance of an external reference resolver class. |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
ParsedList uzuki2::json::parse_file | ( | const std::string & | file, |
Options | options = Options() |
||
) |
Overload of json::parse_file()
assuming that there are no external references.
Provisioner | A class namespace defining static methods for creating new Base objects. See hdf5::parse() for more details. |
file | Path to a (possibly Gzip-compressed) JSON file. |
options | Options for parsing. |
ParsedList
containing a pointer to the root Base
object. Depending on Provisioner
, this may contain references to all nested objects.Any invalid representations in reader
will cause an error to be thrown.
|
inline |
Validate JSON file contents against the uzuki2 specification, given a source of bytes. Any invalid representations will cause an error to be thrown.
reader | Instance of a byteme::Reader providing the contents of the JSON file. |
num_external | Expected number of external references. |
options | Options for parsing. |
|
inline |
Validate JSON file contents against the uzuki2 specification, given a buffer containing the file contents. Any invalid representations will cause an error to be thrown.
[in] | buffer | Pointer to an array containing the JSON file contents (possibly Gzip/Zlib-compressed). |
len | Length of the buffer in bytes. | |
num_external | Expected number of external references. | |
options | Options for parsing. |