|
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... | |
Functions | |
| template<class Provisioner_ , class Externals_ > | |
| ParsedList | parse (byteme::Reader &reader, Externals_ ext, const Options &options) |
| template<class Provisioner_ , class Externals_ > | |
| ParsedList | parse_file (const std::string &file, Externals_ ext, const Options &options) |
| template<class Provisioner_ , class Externals_ > | |
| ParsedList | parse_buffer (const unsigned char *buffer, size_t len, Externals_ ext, const Options &options) |
| void | validate (byteme::Reader &reader, int num_external, const Options &options) |
| void | validate_file (const std::string &file, int num_external, const Options &options) |
| void | validate_buffer (const unsigned char *buffer, size_t len, int num_external, const Options &options) |
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, | ||
| const 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 | Source of input bytes representing 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_buffer | ( | const unsigned char * | buffer, |
| size_t | len, | ||
| Externals_ | ext, | ||
| const 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_file | ( | const std::string & | file, |
| Externals_ | ext, | ||
| const 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.
|
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. |
|
inline |