rustduck-sys 1.1.0

Raw Rust FFI bindings to the C ABI used by TSDuck's Python API
Documentation
#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 &section_file);
std::size_t
rustduck_section_file_binary_size(const RustDuckSectionFile &section_file);
std::size_t
rustduck_section_file_sections_count(const RustDuckSectionFile &section_file);
std::size_t
rustduck_section_file_tables_count(const RustDuckSectionFile &section_file);
void rustduck_section_file_set_crc_validation(RustDuckSectionFile &section_file,
                                              std::int32_t mode);
bool rustduck_section_file_load_binary_buffer(
    RustDuckSectionFile &section_file, rust::Slice<const std::uint8_t> data);
rust::Vec<std::uint8_t>
rustduck_section_file_to_binary(const RustDuckSectionFile &section_file);
bool rustduck_section_file_load_binary(RustDuckSectionFile &section_file,
                                       rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_save_binary(const RustDuckSectionFile &section_file,
                                       rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_load_xml(RustDuckSectionFile &section_file,
                                    rust::Slice<const std::uint8_t> source);
bool rustduck_section_file_save_xml(const RustDuckSectionFile &section_file,
                                    rust::Slice<const std::uint8_t> path);
bool rustduck_section_file_save_json(const RustDuckSectionFile &section_file,
                                     rust::Slice<const std::uint8_t> path);
rust::Vec<std::uint8_t>
rustduck_section_file_to_xml_utf16(const RustDuckSectionFile &section_file);
rust::Vec<std::uint8_t>
rustduck_section_file_to_json_utf16(const RustDuckSectionFile &section_file);

#endif