dbpf

Read and write Database Packed File (DBPF) archives.

Modules

compression
module dbpf.compression

FSH and QFS compression functions.

files
module dbpf.files

File formats used by <a href="https://www.wiki.sc4devotion.com/index.php?title=SimCity_4">SimCity 4</a>, The Sims 2, Spore, etc.

types
module dbpf.types

Members

Aliases

IndexTableV7
alias IndexTableV7 = IndexTable!7
IndexTableV7_1
alias IndexTableV7_1 = IndexTable!(7.1)

Enums

isValidDbpfVersion
eponymoustemplate isValidDbpfVersion(float V)

Determines whether V is a valid DBPF version number.

isValidIndexVersion
eponymoustemplate isValidIndexVersion(float V)

Determines whether V is a valid DBPF Index table version number.

isValidVersion
eponymoustemplate isValidVersion(float DBPF, float V)

Determines whether DBPF and V` are valid DBPF and Index table versions.

Structs

Archive
struct Archive(float DBPF = 1, float V = 7.0)
File
struct File(bool Compressed = Flag!"compressed" = false)

Files fill the bulk of a DBPF archive.

FileHeader
struct FileHeader

Occurs before File.contents only if the File is compressed.

Header
struct Header(float V = 1)
HoleTable
struct HoleTable

A Hole Table contains the location and size of all holes in a DBPF file. Remarks: Holes are created when the game deletes something from a DBPF. The holes themselves are simply junk data of the appropriate length to fill the hole.

IndexTable
struct IndexTable(float V = 7.0)

Index Tables list the contents of a DBPF package. Remarks: The index table is very similar to the directory file (<a href="https://www.wiki.sc4devotion.com/index.php?title=DIR">DIR</a>) within a DPBF package. The difference being that the Index Table lists every file in the package, whereas the directory file only lists the compressed files within the package. <a href="https://www.wiki.sc4devotion.com/index.php?title=Reader">Reader</a> presents a directory file that is a mashup of these two entities, listing every file in the package, as well as indicating whether or not that particular file is compressed.

Version
struct Version

Remarks: For DBPF version specifiers:

  • 1.0 seen in SimCity 4, The Sims 2
  • 1.1 seen in The Sims 2
  • 2.0 seen in Spore, The Sims 3
  • 3.0 seen in SimCity(2013)

For DBPF Index table version specifiers:

  • 7.0 seen in SimCity 4, The Sims 2
  • 7.1 seen in The Sims 2

See Also

  • <a href="https://www.wiki.sc4devotion.com/index.php?title=DBPF">DBPF</a> (SC4D Encyclopedia)
  • <a href="https://www.wiki.sc4devotion.com/index.php?title=List_of_File_Formats">List of File Formats</a> (SC4D Encyclopedia)

Meta

Authors

Chance Snow

License

MIT License