mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
39 lines
843 B
C++
39 lines
843 B
C++
#ifndef DUSK_ISO_VALIDATE_HPP
|
|
#define DUSK_ISO_VALIDATE_HPP
|
|
|
|
#include <atomic>
|
|
|
|
namespace dusk::iso {
|
|
struct KnownDisc;
|
|
|
|
enum class ValidationError : u8 {
|
|
Unknown = 0,
|
|
IOError,
|
|
InvalidImage,
|
|
WrongGame,
|
|
WrongVersion,
|
|
Canceled,
|
|
HashMismatch,
|
|
Success
|
|
};
|
|
|
|
struct VerificationStatus {
|
|
std::atomic_size_t bytesRead = 0;
|
|
std::atomic_size_t bytesTotal = 0;
|
|
const KnownDisc* knownDisc = nullptr;
|
|
std::atomic_bool shouldCancel = false;
|
|
};
|
|
|
|
struct DiscInfo {
|
|
bool isPal = false;
|
|
};
|
|
|
|
ValidationError inspect(const char* path, DiscInfo& info);
|
|
ValidationError validate(const char* path, VerificationStatus& status, DiscInfo& info);
|
|
bool isPal(const char* path);
|
|
void log_verification_state(std::string_view path, DiscVerificationState state);
|
|
|
|
} // namespace dusk::iso
|
|
|
|
#endif // DUSK_ISO_VALIDATE_HPP
|