|
|
|
@ -106,6 +106,15 @@ public class Cache private constructor( |
|
|
|
|
return existsNamed(archive, group.krHashCode(), file.krHashCode()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public fun existsNamedGroup(archive: Int, groupNameHash: Int, file: Int): Boolean { |
|
|
|
|
checkArchive(archive) |
|
|
|
|
return archives[archive]?.existsNamedGroup(groupNameHash, file) ?: false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public fun exists(archive: Int, group: String, file: Int): Boolean { |
|
|
|
|
return existsNamedGroup(archive, group.krHashCode(), file) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public fun list(): Iterator<Int> { |
|
|
|
|
return archives.withIndex() |
|
|
|
|
.filter { it.value != null } |
|
|
|
@ -149,6 +158,17 @@ public class Cache private constructor( |
|
|
|
|
return readNamed(archive, group.krHashCode(), file.krHashCode(), key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun readNamedGroup(archive: Int, groupNameHash: Int, file: Int, key: XteaKey = XteaKey.ZERO): ByteBuf { |
|
|
|
|
checkArchive(archive) |
|
|
|
|
return archives[archive]?.readNamedGroup(groupNameHash, file, key) ?: throw FileNotFoundException() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun read(archive: Int, group: String, file: Int, key: XteaKey = XteaKey.ZERO): ByteBuf { |
|
|
|
|
return readNamedGroup(archive, group.krHashCode(), file, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun write(archive: Int, group: Int, file: Int, buf: ByteBuf, key: XteaKey = XteaKey.ZERO) { |
|
|
|
|
checkArchive(archive) |
|
|
|
@ -172,6 +192,17 @@ public class Cache private constructor( |
|
|
|
|
writeNamed(archive, group.krHashCode(), file.krHashCode(), buf, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun writeNamedGroup(archive: Int, groupNameHash: Int, file: Int, buf: ByteBuf, key: XteaKey = XteaKey.ZERO) { |
|
|
|
|
checkArchive(archive) |
|
|
|
|
createOrGetArchive(archive).writeNamedGroup(groupNameHash, file, buf, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun write(archive: Int, group: String, file: Int, buf: ByteBuf, key: XteaKey = XteaKey.ZERO) { |
|
|
|
|
writeNamedGroup(archive, group.krHashCode(), file, buf, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public fun remove(archive: Int) { |
|
|
|
|
checkArchive(archive) |
|
|
|
|
|
|
|
|
@ -218,6 +249,17 @@ public class Cache private constructor( |
|
|
|
|
return removeNamed(archive, group.krHashCode(), file.krHashCode(), key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun removeNamedGroup(archive: Int, groupNameHash: Int, file: Int, key: XteaKey = XteaKey.ZERO) { |
|
|
|
|
checkArchive(archive) |
|
|
|
|
archives[archive]?.removeNamedGroup(groupNameHash, file, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@JvmOverloads |
|
|
|
|
public fun remove(archive: Int, group: String, file: Int, key: XteaKey = XteaKey.ZERO) { |
|
|
|
|
removeNamedGroup(archive, group.krHashCode(), file, key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Writes pending changes back to the underlying [Store]. |
|
|
|
|
*/ |
|
|
|
|