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 */
605606template <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 */
634635template <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 */
654655template <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 */
674675template <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}
0 commit comments