-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
requested changes yes/no becomes ok/cancel
- Loading branch information
1 parent
c87f753
commit 8fa43d4
Showing
5 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
app/src/main/java/org/stratoemu/strato/utils/CacheManagementUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
* Copyright © 2024 Strato Team and Contributors (https://github.com/strato-emu/) | ||
*/ | ||
|
||
package org.stratoemu.strato.utils | ||
|
||
import org.stratoemu.strato.StratoApplication | ||
import org.stratoemu.strato.getPublicFilesDir | ||
import java.io.File | ||
|
||
class CacheManagementUtils { | ||
|
||
companion object { | ||
private val cacheFolderRoot by lazy { "${StratoApplication.instance.getPublicFilesDir().canonicalPath}/graphics_pipeline_cache/" } | ||
|
||
fun pipelineCacheExists(titleId: String) : Boolean { | ||
val cacheFolderPath = cacheFolderRoot + titleId | ||
val cacheFolderPathExt = "$cacheFolderRoot$titleId.staging" | ||
|
||
return File(cacheFolderPath).exists() && File(cacheFolderPathExt).exists() | ||
} | ||
|
||
/** | ||
* Deletes the cache files for a given game. | ||
*/ | ||
fun deleteCacheFile(titleId : String) : Boolean { | ||
return File("${cacheFolderRoot}$titleId").delete() | ||
&& File("${cacheFolderRoot}$titleId.staging").delete() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters