#ifndef RUSTDUCK_BRIDGE_SECTION_FILE_H
#define RUSTDUCK_BRIDGE_SECTION_FILE_H
#include "rustduck-sys/native/bridge/common.h"
#include <memory>
class RustDuckDuckContext;
class RustDuckSectionFile final {
public:
explicit RustDuckSectionFile(std::shared_ptr<void> section_file) noexcept;
~RustDuckSectionFile() noexcept;
RustDuckSectionFile(const RustDuckSectionFile &) = delete;
RustDuckSectionFile &operator=(const RustDuckSectionFile &) = delete;
void *raw() const noexcept;
private:
std::shared_ptr<void> section_file_;
};
std::unique_ptr<RustDuckSectionFile>
rustduck_section_file_new(const RustDuckDuckContext &context);
void rustduck_section_file_clear(RustDuckSectionFile §ion_file);
std::size_t
rustduck_section_file_binary_size(const RustDuckSectionFile §ion_file);
std::size_t
rustduck_section_file_sections_count(const RustDuckSectionFile §ion_file);
std::size_t
rustduck_section_file_tables_count(const RustDuckSectionFile §ion_file);
void rustduck_section_file_set_crc_validation(RustDuckSectionFile §ion_file,
std::int32_t mode);
bool rustduck_section_file_load_binary_buffer(
RustDuckSectionFile §ion_file, rust::Slice<const std::uint8_t> data);
rust::Vec<std::uint8_t>
rustduck_section_file_to_binary(const RustDuckSectionFile §ion_file);
bool rustduck_section_file_load_binary(RustDuckSectionFile §ion_file,
rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_save_binary(const RustDuckSectionFile §ion_file,
rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_load_xml(RustDuckSectionFile §ion_file,
rust::Slice<const std::uint8_t> source);
bool rustduck_section_file_save_xml(const RustDuckSectionFile §ion_file,
rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_save_json(const RustDuckSectionFile §ion_file,
rust::Slice<const std::uint8_t> path);
rust::Vec<std::uint8_t>
rustduck_section_file_to_xml_utf16(const RustDuckSectionFile §ion_file);
rust::Vec<std::uint8_t>
rustduck_section_file_to_json_utf16(const RustDuckSectionFile §ion_file);
#endif