summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/fileio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/fileio.h')
-rw-r--r--src/emu/fileio.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/emu/fileio.h b/src/emu/fileio.h
index 20be11eb022..225cebd0a81 100644
--- a/src/emu/fileio.h
+++ b/src/emu/fileio.h
@@ -18,6 +18,7 @@
#include <iterator>
#include <string>
+#include <system_error>
#include <type_traits>
#include <utility>
#include <vector>
@@ -60,7 +61,7 @@ public:
path_iterator &operator=(path_iterator const &that);
// main interface
- bool next(std::string &buffer, const char *name = nullptr);
+ bool next(std::string &buffer);
void reset();
private:
@@ -107,7 +108,7 @@ public:
file_enumerator &operator=(file_enumerator const &) = delete;
// iterator
- const osd::directory::entry *next();
+ const osd::directory::entry *next(const char *subdir = nullptr);
private:
// internal state
@@ -148,7 +149,7 @@ public:
const char *filename() const { return m_filename.c_str(); }
const char *fullpath() const { return m_fullpath.c_str(); }
u32 openflags() const { return m_openflags; }
- util::hash_collection &hashes(const char *types);
+ util::hash_collection &hashes(std::string_view types);
// setters
void remove_on_close() { m_remove_on_close = true; }
@@ -156,17 +157,18 @@ public:
void set_restrict_to_mediapath(int rtmp) { m_restrict_to_mediapath = rtmp; }
// open/close
- osd_file::error open(const std::string &name);
- osd_file::error open(const std::string &name, u32 crc);
- osd_file::error open_next();
- osd_file::error open_ram(const void *data, u32 length);
+ std::error_condition open(std::string &&name);
+ std::error_condition open(std::string &&name, u32 crc);
+ std::error_condition open(std::string_view name) { return open(std::string(name)); }
+ std::error_condition open(std::string_view name, u32 crc) { return open(std::string(name), crc); }
+ std::error_condition open(const char *name) { return open(std::string(name)); }
+ std::error_condition open(const char *name, u32 crc) { return open(std::string(name), crc); }
+ std::error_condition open_next();
+ std::error_condition open_ram(const void *data, u32 length);
void close();
- // control
- osd_file::error compress(int compress);
-
// position
- int seek(s64 offset, int whence);
+ std::error_condition seek(s64 offset, int whence);
u64 tell();
bool eof();
u64 size();
@@ -179,8 +181,8 @@ public:
// writing
u32 write(const void *buffer, u32 length);
- int puts(const char *s);
- int vprintf(util::format_argument_pack<std::ostream> const &args);
+ int puts(std::string_view s);
+ int vprintf(util::format_argument_pack<char> const &args);
template <typename Format, typename... Params> int printf(Format &&fmt, Params &&...args)
{
return vprintf(util::make_format_argument_pack(std::forward<Format>(fmt), std::forward<Params>(args)...));
@@ -209,11 +211,11 @@ private:
}
bool part_of_mediapath(const std::string &path);
- bool compressed_file_ready();
+ std::error_condition compressed_file_ready();
// internal helpers
- osd_file::error attempt_zipped();
- osd_file::error load_zipped_file();
+ std::error_condition attempt_zipped();
+ std::error_condition load_zipped_file();
// internal state
std::string m_filename; // original filename provided