summaryrefslogtreecommitdiffstats
path: root/src/lib/formats/cassimg.h
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2021-08-22 09:06:15 +1000
committer GitHub <noreply@github.com>2021-08-22 09:06:15 +1000
commite8bbea1fc6e94e14768509d322f6c624403ffb36 (patch)
tree74dd1606a900d83de8aecff17a6737af4113308d /src/lib/formats/cassimg.h
parente319bde5fc3696d7f48f62b15b6366c4377fe5d1 (diff)
formats, osd, util: Started refactoring file I/O stuff. (#8456)
Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
Diffstat (limited to 'src/lib/formats/cassimg.h')
-rw-r--r--src/lib/formats/cassimg.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/formats/cassimg.h b/src/lib/formats/cassimg.h
index 3a59870571a..765b860b659 100644
--- a/src/lib/formats/cassimg.h
+++ b/src/lib/formats/cassimg.h
@@ -185,14 +185,14 @@ public:
void dump(const char *filename);
error save();
- void change(void *file, const io_procs *procs, const Format *format, int flags);
+ void change(util::random_read_write::ptr &&io, const Format *format, int flags);
Info get_info() const;
- static error open(void *file, const io_procs *procs,
+ static error open(util::random_read_write::ptr &&io,
const Format *format, int flags, ptr &outcassette);
- static error open_choices(void *file, const io_procs *procs, const std::string &extension,
+ static error open_choices(util::random_read_write::ptr &&io, const std::string &extension,
const Format *const *formats, int flags, ptr &outcassette);
- static error create(void *file, const io_procs *procs, const cassette_image::Format *format,
+ static error create(util::random_read_write::ptr &&io, const cassette_image::Format *format,
const cassette_image::Options *opts, int flags, ptr &outcassette);
// builtin formats
@@ -201,7 +201,7 @@ public:
private:
struct manipulation_ranges;
- cassette_image(const Format *format, void *file, const io_procs *procs, int flags);
+ cassette_image(const Format *format, util::random_read_write::ptr &&io, int flags);
cassette_image(const cassette_image &) = delete;
cassette_image(cassette_image &&) = delete;
cassette_image &operator=(const cassette_image &) = delete;
@@ -212,15 +212,15 @@ private:
error compute_manipulation_ranges(int channel, double time_index, double sample_period, manipulation_ranges &ranges) const;
error lookup_sample(int channel, size_t sample, int32_t *&ptr);
- const Format *m_format = nullptr;
- io_generic m_io;
+ const Format *m_format;
+ util::random_read_write::ptr m_io;
- int m_channels = 0;
- int m_flags = 0;
- uint32_t m_sample_frequency = 0;
+ int m_channels;
+ int m_flags;
+ uint32_t m_sample_frequency;
std::vector<std::unique_ptr<int32_t []> > m_blocks;
- size_t m_sample_count = 0;
+ size_t m_sample_count;
};
/* macros for specifying format lists */