This commit is contained in:
relikd
2025-11-25 22:46:14 +01:00
commit a28636a7ca
28 changed files with 2380 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
/**
* Array mapping strings in the string pool back to resource identifiers.
*/
/// Header size: `ChunkHeader` (8B) + `0 Bytes`
public struct XmlResourceMap {
let header: ChunkHeader
init(_ chunk: ChunkHeader) {
header = chunk
}
public var count: Int {
(header.index(.afterChunk) - header.index(.startOfData)) / 4
}
public func entries() -> [TblTableRef] {
var br = header.byteReader(at: .startOfData)
return (0..<count).map { _ in TblTableRef(br.read32()) }
}
}