refactor: remove deprecated methods in ResourceData.kt

This commit is contained in:
Lucaskyy 2022-06-26 16:53:25 +02:00
parent 2b492e7a5e
commit 35749454ab
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89
2 changed files with 0 additions and 22 deletions

View file

@ -15,16 +15,6 @@ class ResourceData(private val resourceCacheDirectory: File) : Data {
fun forEach(action: (File) -> Unit) = resourceCacheDirectory.walkTopDown().forEach(action)
fun get(path: String) = resolve(path)
fun replace(path: String, oldValue: String, newValue: String, oldValueIsRegex: Boolean = false) {
// TODO: buffer this somehow
val content = resolve(path).readText()
if (oldValueIsRegex) {
content.replace(Regex(oldValue), newValue)
return
}
}
fun getXmlEditor(path: String) = DomFileEditor(resolve(path))
}

View file

@ -30,18 +30,6 @@ class ExampleResourcePatch : ResourcePatch() {
)
}
// iterate through all available resources
data.forEach {
if (it.extension.lowercase() != "xml") return@forEach
data.replace(
it.path,
"\\ddip", // regex supported
"0dip",
true
)
}
return PatchResultSuccess()
}
}