File indexing completed on 2025-01-05 04:01:18

0001 /*
0002  * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include "io/binary_stream.hpp"
0010 
0011 #include "type_system.hpp"
0012 #include "rive_format.hpp"
0013 
0014 namespace glaxnimate::io::rive {
0015 
0016 
0017 class RiveLoader
0018 {
0019 public:
0020     RiveLoader(BinaryInputStream& stream, RiveFormat* format);
0021 
0022     std::vector<Object> load_object_list();
0023 
0024     bool load_document(model::Document* document);
0025 
0026     const PropertyTable& extra_properties() const;
0027 
0028 private:
0029     Object read_object();
0030 
0031     QVariant read_property_value(PropertyType type);
0032     PropertyTable read_property_table();
0033     void skip_value(PropertyType type);
0034 
0035     QByteArray read_raw_string();
0036     QString read_string_utf8();
0037 
0038     BinaryInputStream& stream;
0039     RiveFormat* format;
0040     PropertyTable extra_props;
0041     TypeSystem types;
0042 };
0043 
0044 } // namespace glaxnimate::io::rive