diff options
Diffstat (limited to 'src/emu/fileio.h')
-rw-r--r-- | src/emu/fileio.h | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/src/emu/fileio.h b/src/emu/fileio.h index 22f36f5362e..c54c740d686 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -10,11 +10,12 @@ #pragma once -#ifndef __FILEIO_H__ -#define __FILEIO_H__ +#ifndef MAME_EMU_FILEIO_H +#define MAME_EMU_FILEIO_H #include "corefile.h" #include "hash.h" +#include "unzip.h" // some systems use macros for getc/putc rather than functions #ifdef getc @@ -26,11 +27,7 @@ //************************************************************************** // forward declarations -struct zip_file_header; -struct zip_file; - -struct _7z_file_header; -struct _7z_file; +class _7z_file; // ======================> path_iterator @@ -105,20 +102,20 @@ public: void set_restrict_to_mediapath(bool rtmp = true) { m_restrict_to_mediapath = rtmp; } // open/close - file_error open(const char *name); - file_error open(const char *name1, const char *name2); - file_error open(const char *name1, const char *name2, const char *name3); - file_error open(const char *name1, const char *name2, const char *name3, const char *name4); - file_error open(const char *name, UINT32 crc); - file_error open(const char *name1, const char *name2, UINT32 crc); - file_error open(const char *name1, const char *name2, const char *name3, UINT32 crc); - file_error open(const char *name1, const char *name2, const char *name3, const char *name4, UINT32 crc); - file_error open_next(); - file_error open_ram(const void *data, UINT32 length); + osd_file::error open(const char *name); + osd_file::error open(const char *name1, const char *name2); + osd_file::error open(const char *name1, const char *name2, const char *name3); + osd_file::error open(const char *name1, const char *name2, const char *name3, const char *name4); + osd_file::error open(const char *name, UINT32 crc); + osd_file::error open(const char *name1, const char *name2, UINT32 crc); + osd_file::error open(const char *name1, const char *name2, const char *name3, UINT32 crc); + osd_file::error open(const char *name1, const char *name2, const char *name3, const char *name4, UINT32 crc); + osd_file::error open_next(); + osd_file::error open_ram(const void *data, UINT32 length); void close(); // control - file_error compress(int compress); + osd_file::error compress(int compress); // position int seek(INT64 offset, int whence); @@ -148,13 +145,13 @@ private: bool compressed_file_ready(void); // internal helpers - file_error attempt_zipped(); - file_error load_zipped_file(); - bool zip_filename_match(const zip_file_header &header, const std::string &filename); - bool zip_header_is_path(const zip_file_header &header); + osd_file::error attempt_zipped(); + osd_file::error load_zipped_file(); + bool zip_filename_match(const zip_file::file_header &header, const std::string &filename); + bool zip_header_is_path(const zip_file::file_header &header); - file_error attempt__7zped(); - file_error load__7zped_file(); + osd_file::error attempt__7zped(); + osd_file::error load__7zped_file(); // internal state std::string m_filename; // original filename provided @@ -166,17 +163,16 @@ private: UINT32 m_openflags; // flags we used for the open hash_collection m_hashes; // collection of hashes - zip_file * m_zipfile; // ZIP file pointer + zip_file::ptr m_zipfile; // ZIP file pointer dynamic_buffer m_zipdata; // ZIP file data UINT64 m_ziplength; // ZIP file length - _7z_file * m__7zfile; // 7Z file pointer + std::unique_ptr<_7z_file> m__7zfile; // 7Z file pointer dynamic_buffer m__7zdata; // 7Z file data UINT64 m__7zlength; // 7Z file length bool m_remove_on_close; // flag: remove the file when closing - bool m_restrict_to_mediapath; // flag: restrict to paths inside the media-path + bool m_restrict_to_mediapath; // flag: restrict to paths inside the media-path }; - -#endif /* __FILEIO_H__ */ +#endif // MAME_EMU_FILEIO_H |