Skip to content

Commit 29e9107

Browse files
committed
Forgot to actually return a ParsedList for the HDF5 parsers.
Fixed the JSON docs to indicate that we're returning ParsedLists.
1 parent fc64dff commit 29e9107

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.24)
22

33
project(uzuki2
4-
VERSION 1.1.2
4+
VERSION 1.1.3
55
DESCRIPTION "Storing simple R lists inside HDF5 or JSON"
66
LANGUAGES CXX)
77

include/uzuki2/parse_hdf5.hpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "Dummy.hpp"
1717
#include "utils.hpp"
1818
#include "Version.hpp"
19+
#include "ParsedList.hpp"
1920

2021
/**
2122
* @file parse_hdf5.hpp
@@ -565,7 +566,7 @@ std::shared_ptr<Base> parse_inner(const H5::Group& handle, Externals& ext, const
565566
* Only used for error messages.
566567
* @param ext Instance of an external reference resolver class.
567568
*
568-
* @return Pointer to the root `Base` object.
569+
* @return A `ParsedList` containing a pointer to the root `Base` object.
569570
* Depending on `Provisioner`, this may contain references to all nested objects.
570571
*
571572
* Any invalid representations in `contents` will cause an error to be thrown.
@@ -603,7 +604,7 @@ std::shared_ptr<Base> parse_inner(const H5::Group& handle, Externals& ext, const
603604
* - `size_t size()`, which returns the number of available external references.
604605
*/
605606
template<class Provisioner, class Externals>
606-
std::shared_ptr<Base> parse(const H5::Group& handle, const std::string& name, Externals ext) {
607+
ParsedList parse(const H5::Group& handle, const std::string& name, Externals ext) {
607608
Version version;
608609
if (handle.attrExists("uzuki_version")) {
609610
auto ver_str = load_string_attribute(handle.openAttribute("uzuki_version"), "uzuki_version", name);
@@ -613,7 +614,7 @@ std::shared_ptr<Base> parse(const H5::Group& handle, const std::string& name, Ex
613614
ExternalTracker etrack(std::move(ext));
614615
auto ptr = parse_inner<Provisioner>(handle, etrack, name, version);
615616
etrack.validate();
616-
return ptr;
617+
return ParsedList(std::move(ptr), std::move(version));
617618
}
618619

619620
/**
@@ -626,13 +627,13 @@ std::shared_ptr<Base> parse(const H5::Group& handle, const std::string& name, Ex
626627
* @param name Name of the HDF5 group corresponding to `handle`.
627628
* Only used for error messages.
628629
*
629-
* @return Pointer to the root `Base` object.
630+
* @return A `ParsedList` containing a pointer to the root `Base` object.
630631
* Depending on `Provisioner`, this may contain references to all nested objects.
631632
*
632633
* Any invalid representations in `contents` will cause an error to be thrown.
633634
*/
634635
template<class Provisioner>
635-
std::shared_ptr<Base> parse(const H5::Group& handle, const std::string& name) {
636+
ParsedList parse(const H5::Group& handle, const std::string& name) {
636637
return parse<Provisioner>(handle, name, uzuki2::DummyExternals(0));
637638
}
638639

@@ -646,13 +647,13 @@ std::shared_ptr<Base> parse(const H5::Group& handle, const std::string& name) {
646647
* @param name Name of the HDF5 group containing the list in `file`.
647648
* @param ext Instance of an external reference resolver class.
648649
*
649-
* @return Pointer to the root `Base` object.
650+
* @return A `ParsedList` containing a pointer to the root `Base` object.
650651
* Depending on `Provisioner`, this may contain references to all nested objects.
651652
*
652653
* Any invalid representations in `contents` will cause an error to be thrown.
653654
*/
654655
template<class Provisioner, class Externals>
655-
std::shared_ptr<Base> parse(const std::string& file, const std::string& name, Externals ext) {
656+
ParsedList parse(const std::string& file, const std::string& name, Externals ext) {
656657
H5::H5File handle(file, H5F_ACC_RDONLY);
657658
return parse<Provisioner>(handle.openGroup(name), name, std::move(ext));
658659
}
@@ -666,13 +667,13 @@ std::shared_ptr<Base> parse(const std::string& file, const std::string& name, Ex
666667
* @param file Path to a HDF5 file.
667668
* @param name Name of the HDF5 group containing the list in `file`.
668669
*
669-
* @return Pointer to the root `Base` object.
670+
* @return A `ParsedList` containing a pointer to the root `Base` object.
670671
* Depending on `Provisioner`, this may contain references to all nested objects.
671672
*
672673
* Any invalid representations in `contents` will cause an error to be thrown.
673674
*/
674675
template<class Provisioner>
675-
std::shared_ptr<Base> parse(const std::string& file, const std::string& name) {
676+
ParsedList parse(const std::string& file, const std::string& name) {
676677
H5::H5File handle(file, H5F_ACC_RDONLY);
677678
return parse<Provisioner>(handle.openGroup(name), name, uzuki2::DummyExternals(0));
678679
}

include/uzuki2/parse_json.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ struct Options {
409409
* @param ext Instance of an external reference resolver class.
410410
* @param options Options for parsing.
411411
*
412-
* @return Pointer to the root `Base` object.
412+
* @return A `ParsedList` containing a pointer to the root `Base` object.
413413
* Depending on `Provisioner`, this may contain references to all nested objects.
414414
*
415415
* Any invalid representations in `reader` will cause an error to be thrown.
@@ -454,7 +454,7 @@ ParsedList parse(byteme::Reader& reader, Externals ext, Options options = Option
454454
* @param reader Instance of a `byteme::Reader` providing the contents of the JSON file.
455455
* @param options Options for parsing.
456456
*
457-
* @return Pointer to the root `Base` object.
457+
* @return A `ParsedList` containing a pointer to the root `Base` object.
458458
* Depending on `Provisioner`, this may contain references to all nested objects.
459459
*
460460
* Any invalid representations in `reader` will cause an error to be thrown.
@@ -477,7 +477,7 @@ ParsedList parse(byteme::Reader& reader, Options options = Options()) {
477477
* @param ext Instance of an external reference resolver class.
478478
* @param options Options for parsing.
479479
*
480-
* @return Pointer to the root `Base` object.
480+
* @return A `ParsedList` containing a pointer to the root `Base` object.
481481
* Depending on `Provisioner`, this may contain references to all nested objects.
482482
*
483483
* Any invalid representations in `reader` will cause an error to be thrown.
@@ -497,7 +497,7 @@ ParsedList parse_file(const std::string& file, Externals ext, Options options =
497497
* @param file Path to a (possibly Gzip-compressed) JSON file.
498498
* @param options Options for parsing.
499499
*
500-
* @return Pointer to the root `Base` object.
500+
* @return A `ParsedList` containing a pointer to the root `Base` object.
501501
* Depending on `Provisioner`, this may contain references to all nested objects.
502502
*
503503
* Any invalid representations in `reader` will cause an error to be thrown.
@@ -521,7 +521,7 @@ ParsedList parse_file(const std::string& file, Options options = Options()) {
521521
* @param ext Instance of an external reference resolver class.
522522
* @param options Options for parsing.
523523
*
524-
* @return Pointer to the root `Base` object.
524+
* @return A `ParsedList` containing a pointer to the root `Base` object.
525525
* Depending on `Provisioner`, this may contain references to all nested objects.
526526
*
527527
* Any invalid representations in `reader` will cause an error to be thrown.
@@ -542,7 +542,7 @@ ParsedList parse_buffer(const unsigned char* buffer, size_t len, Externals ext,
542542
* @param len Length of the buffer in bytes.
543543
* @param options Options for parsing.
544544
*
545-
* @return Pointer to the root `Base` object.
545+
* @return A `ParsedList` containing a pointer to the root `Base` object.
546546
* Depending on `Provisioner`, this may contain references to all nested objects.
547547
*
548548
* Any invalid representations in `reader` will cause an error to be thrown.

0 commit comments

Comments
 (0)