diff options
author | 2021-08-22 09:06:15 +1000 | |
---|---|---|
committer | 2021-08-22 09:06:15 +1000 | |
commit | e8bbea1fc6e94e14768509d322f6c624403ffb36 (patch) | |
tree | 74dd1606a900d83de8aecff17a6737af4113308d /src/frontend/mame/audit.cpp | |
parent | e319bde5fc3696d7f48f62b15b6366c4377fe5d1 (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/frontend/mame/audit.cpp')
-rw-r--r-- | src/frontend/mame/audit.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp index 42ddcdad438..0a37c4a3fff 100644 --- a/src/frontend/mame/audit.cpp +++ b/src/frontend/mame/audit.cpp @@ -425,11 +425,11 @@ media_auditor::summary media_auditor::audit_samples() while (path.next(curpath, samplename)) { // attempt to access the file (.flac) or (.wav) - osd_file::error filerr = file.open(curpath + ".flac"); - if (filerr != osd_file::error::NONE) + std::error_condition filerr = file.open(curpath + ".flac"); + if (filerr) filerr = file.open(curpath + ".wav"); - if (filerr == osd_file::error::NONE) + if (!filerr) { record.set_status(audit_status::GOOD, audit_substatus::GOOD); found++; @@ -589,14 +589,14 @@ media_auditor::audit_record &media_auditor::audit_one_rom(const std::vector<std: file.set_restrict_to_mediapath(1); // open the file if we can - osd_file::error filerr; + std::error_condition filerr; if (has_crc) filerr = file.open(record.name(), crc); else filerr = file.open(record.name()); // if it worked, get the actual length and hashes, then stop - if (filerr == osd_file::error::NONE) + if (!filerr) record.set_actual(file.hashes(m_validation), file.size()); // compute the final status @@ -617,10 +617,10 @@ media_auditor::audit_record &media_auditor::audit_one_disk(const rom_entry *rom, // open the disk chd_file source; - const chd_error err = rom_load_manager::open_disk_image(m_enumerator.options(), std::forward<T>(args)..., rom, source); + const std::error_condition err = rom_load_manager::open_disk_image(m_enumerator.options(), std::forward<T>(args)..., rom, source); // if we succeeded, get the hashes - if (err == CHDERR_NONE) + if (!err) { util::hash_collection hashes; @@ -633,7 +633,7 @@ media_auditor::audit_record &media_auditor::audit_one_disk(const rom_entry *rom, } // compute the final status - compute_status(record, rom, err == CHDERR_NONE); + compute_status(record, rom, !err); return record; } |