99 std::filesystem::path
path;
248 std::optional<SaveLocation>
getSaveLocation(
const std::string& gameId)
const;
256 std::vector<SaveLocation>
258 const std::filesystem::path& prefixPath = {})
const;
270 std::optional<std::string>
createSnapshot(
const std::string& gameId,
271 const std::string& description =
"");
276 std::future<std::optional<std::string>>
284 std::vector<SaveSnapshot>
getSnapshots(
const std::string& gameId)
const;
291 std::optional<SaveSnapshot>
getSnapshot(
const std::string& snapshotId)
const;
299 bool restoreSnapshot(
const std::string& snapshotId,
bool backupCurrent =
true);
314 int pruneSnapshots(
const std::string& gameId,
int keepCount = 10);
328 bool syncSaves(
const std::string& gameId,
346 bool needsSync(
const std::string& gameId)
const;
362 bool resolveConflict(
const std::string& gameId,
const std::string& filePath,
374 void setAutoSync(
const std::string& gameId,
bool enabled);
456 std::unique_ptr<Impl> impl_;
459 std::vector<SaveFile> scanSaveFiles(
const SaveLocation& location)
const;
460 std::string calculateChecksum(
const std::filesystem::path& path)
const;
461 bool copyFiles(
const std::vector<SaveFile>& files,
const std::filesystem::path& destDir,
463 std::string generateSnapshotId()
const;
464 void loadSaveLocations();
465 void saveSaveLocations()
const;
466 void loadSnapshots();
void setCustomSyncDirectory(const std::filesystem::path &path)
Set custom sync directory.
bool needsSync(const std::string &gameId) const
Check if sync is needed.
void setBackupDirectory(const std::filesystem::path &path)
Set the local backup directory.
std::function< void(const SyncStatus &)> ProgressCallback
bool resolveConflict(const std::string &gameId, const std::string &filePath, ConflictResolution resolution)
Resolve a conflict.
std::optional< std::string > createSnapshot(const std::string &gameId, const std::string &description="")
Create a snapshot of current saves.
std::vector< SaveSnapshot > getSnapshots(const std::string &gameId) const
List all snapshots for a game.
void setAutoSync(const std::string &gameId, bool enabled)
Enable auto-sync for a game.
void setMaxSnapshotsPerGame(int count)
Set maximum snapshots per game.
bool restoreSnapshot(const std::string &snapshotId, bool backupCurrent=true)
Restore saves from a snapshot.
int getSnapshotCount(const std::string &gameId) const
Get snapshot count for a game.
void onGameLaunch(const std::string &gameId)
Called when a game is about to launch.
void onGameExit(const std::string &gameId)
Called when a game exits.
bool updateSaveLocation(const SaveLocation &location)
Update an existing save location.
int64_t getTotalBackupSize() const
Get total backup size for all games.
std::vector< SyncConflict > getPendingConflicts(const std::string &gameId) const
Get pending conflicts.
bool deleteSnapshot(const std::string &snapshotId)
Delete a snapshot.
bool registerSaveLocation(const SaveLocation &location)
Register a game's save location.
void setDefaultConflictResolution(ConflictResolution resolution)
Set default conflict resolution.
std::future< bool > syncSavesAsync(const std::string &gameId, SyncDirection direction=SyncDirection::Bidirectional, const ProgressCallback &progressCallback=nullptr, const ConflictCallback &conflictCallback=nullptr)
Sync asynchronously.
std::vector< SaveLocation > getSaveLocations() const
Get all registered save locations.
void cancelOperation()
Cancel ongoing operation.
std::optional< SaveLocation > getSaveLocation(const std::string &gameId) const
Get save location for a specific game.
std::function< ConflictResolution(const SyncConflict &)> ConflictCallback
std::future< std::optional< std::string > > createSnapshotAsync(const std::string &gameId, const std::string &description="")
Create snapshot asynchronously.
std::optional< SaveSnapshot > getSnapshot(const std::string &snapshotId) const
Get a specific snapshot.
std::vector< SaveLocation > detectSaveLocation(const std::string &gameName, const std::filesystem::path &prefixPath={}) const
Detect save location for a game.
bool removeSaveLocation(const std::string &gameId)
Remove a save location registration.
bool syncSaves(const std::string &gameId, SyncDirection direction=SyncDirection::Bidirectional, const ProgressCallback &progressCallback=nullptr, const ConflictCallback &conflictCallback=nullptr)
Sync saves with cloud storage.
int pruneSnapshots(const std::string &gameId, int keepCount=10)
Delete old snapshots.
std::filesystem::path getBackupDirectory() const
Get the backup directory.
std::string syncDirectionName(SyncDirection direction)
Get human-readable sync direction name.
SyncDirection
Direction of sync operation.
@ Download
Cloud -> Local.
@ Bidirectional
Two-way sync.
std::string cloudBackendName(CloudBackend backend)
Get human-readable backend name.
ConflictResolution
How to resolve sync conflicts.
@ AskUser
Prompt user to choose.
@ UseRemote
Keep remote version.
@ UseNewest
Use whichever is newer.
@ KeepBoth
Keep both versions (create backup).
@ UseLocal
Keep local version.
CloudBackend
Supported cloud storage backends.
@ Custom
Custom sync location (e.g., Syncthing, Nextcloud).
Information about a specific save file.
std::string getFormattedSize() const
std::string getFormattedTime() const
std::chrono::system_clock::time_point modifiedTime
std::string relativePath
Path relative to save root.
int64_t size
File size in bytes.
std::string checksum
SHA-256 hash for comparison.
std::filesystem::path path
Full path to file.
Information about a game's save location.
bool autoSync
Auto-sync on launch/exit.
std::string notes
User notes about this save location.
std::filesystem::path localPath
Local save directory.
std::filesystem::path prefixPath
Wine prefix path if applicable.
std::string gameName
Display name.
std::string pattern
File pattern (e.g., "*.sav", "**/*").
std::string gameId
Internal game ID.
std::vector< std::string > excludePatterns
Patterns to exclude.
bool isWinePrefix
Save is in a Wine prefix.
A complete snapshot of a game's saves at a point in time.
std::vector< SaveFile > files
Files in this snapshot.
std::string gameName
Game display name.
int64_t totalSize
Total size of all files.
std::string getFormattedTime() const
std::chrono::system_clock::time_point timestamp
std::string id
Unique snapshot ID.
std::string gameId
Game this belongs to.
std::string getFormattedSize() const
bool isAutomatic
True if auto-created.
std::string description
User-provided description.
Details about a sync conflict.
std::string resolution
How it was resolved (if auto).
Status of sync operation.
std::vector< std::string > conflicts
std::string getStateStr() const