This is a DBPF library written in Scala, which runs on the JVM. Its most important features are immutability, which makes the library thread-safe, as well as a simple API, which also makes it particularly suitable for scripting.
Currently, only DBPF format version 1.0 is supported, which is used by SimCity 4. The most common DBPF types are supported, such as Exemplar, Cohort, SC4Paths, S3D, FSH, LText.
This library has evolved from the jDBPFX library; yet, almost everything has been rewritten entirely.
Add the following to your build.sbt
file:
libraryDependencies += "io.github.memo33" %% "scdbpf" % "0.2.1"
The latest version is available on Maven Central.
See here for the current
documentation.
It can also be generated via sbt doc
. The main page contains
some examples to get started. For example, the task of sorting the
entries of a DBPF file by TGI would be achieved via sbt console
like
this:
val dbpf = DbpfFile.read(new File("foobar.dat"))
dbpf.write(dbpf.entries.sortBy(_.tgi))
Support is provided at SC4Devotion.com.
The source files can be found at GitHub.com.
This library is released under the MIT license (see included license file).