67 std::filesystem::path
path;
103 std::vector<FileVerificationResult>
files;
165 std::vector<FileVerificationResult>
files;
167 std::chrono::system_clock::time_point
created;
170 return !
files.empty();
219 const std::filesystem::path& gamePath,
229 std::future<GameVerificationResult>
230 verifyGameAsync(
const std::string& gameId,
const std::filesystem::path& gamePath,
265 std::optional<GameManifest>
loadSteamManifest(uint32_t appId, uint32_t depotId = 0);
280 const std::string& checksumType =
"sha256",
296 std::optional<GameManifest>
loadManifest(
const std::filesystem::path& path);
303 std::filesystem::path
getManifestPath(
const std::string& gameId)
const;
316 const std::string& type);
341 std::optional<GameVerificationResult>
getCachedResult(
const std::string& gameId)
const;
347 void clearCache(
const std::string& gameId =
"");
357 std::unique_ptr<Impl> impl_;
361 const std::filesystem::path& gamePath,
363 std::atomic<bool>& cancelled);
366 const std::filesystem::path& gamePath);
GameVerificationResult verifySteamGame(uint32_t appId, const std::filesystem::path &gamePath, const ProgressCallback &progressCallback=nullptr)
Verify a Steam game using depot manifests.
GameVerificationResult verifyGame(const std::string &gameId, const std::filesystem::path &gamePath, const ProgressCallback &progressCallback=nullptr)
Verify a game's file integrity.
static std::string calculateChecksum(const std::filesystem::path &path, const std::string &type)
Calculate checksum of a file.
std::function< void(const VerificationProgress &)> ProgressCallback
bool isVerifying(const std::string &gameId) const
Check if verification is in progress.
void clearCache(const std::string &gameId="")
Clear verification cache.
FileVerificationService()
std::optional< GameManifest > loadSteamManifest(uint32_t appId, uint32_t depotId=0)
Load Steam depot manifest for a game.
std::optional< GameVerificationResult > getCachedResult(const std::string &gameId) const
Get cached verification result.
std::optional< GameManifest > loadManifest(const std::filesystem::path &path)
Load a manifest from file.
void setCacheValidity(int seconds)
Set cache validity duration.
std::filesystem::path getManifestPath(const std::string &gameId) const
Get default manifest path for a game.
std::future< GameVerificationResult > verifyGameAsync(const std::string &gameId, const std::filesystem::path &gamePath, const ProgressCallback &progressCallback=nullptr)
Verify a game asynchronously.
void cancelVerification(const std::string &gameId)
Cancel an ongoing verification.
bool saveManifest(const GameManifest &manifest, const std::filesystem::path &path)
Save a manifest to file.
~FileVerificationService()
GameManifest generateManifest(const std::string &gameId, const std::filesystem::path &gamePath, const std::string &checksumType="sha256", const ProgressCallback &progressCallback=nullptr)
Generate a manifest for a game installation.
FileVerificationResult verifyFile(const std::filesystem::path &basePath, const FileVerificationResult &expected)
Verify a single file.
VerificationStatus
Status of a file verification check.
@ Missing
File doesn't exist.
@ Valid
File matches expected checksum/size.
@ Invalid
File doesn't match (corrupted or modified).
@ Repairable
Invalid but can be repaired.
@ ExtraFile
File exists but not in manifest.
@ SizeMismatch
File exists but wrong size.
@ Unknown
Not yet verified.
@ Skipped
Verification was skipped.
std::string verificationStatusName(VerificationStatus status)
Get human-readable name for verification status.
Result of verifying a single file.
VerificationStatus status
std::string actualChecksum
std::string expectedChecksum
std::string checksumType
"md5", "sha1", "sha256"
std::filesystem::path path
File path (relative to game root).
Manifest file containing expected file checksums.
std::chrono::system_clock::time_point created
std::vector< FileVerificationResult > files
std::string checksumType
Default checksum type for files.
Complete verification result for a game.
std::vector< FileVerificationResult > files
std::chrono::system_clock::time_point verificationTime
float getCompletionPercentage() const
std::filesystem::path gamePath
Progress information during verification.
std::string getStateStr() const