~quf/libcs3tio

c++ library for input/output of cold steel 3 tables
senschema update
fix element enum
senschema update

refs

trunk
browse  log 

clone

read-only
https://git.sr.ht/~quf/libcs3tio
read/write
git@git.sr.ht:~quf/libcs3tio

You can also use your local clone with git send-email.

#cold steel 3 table input/output library

C++ library to read/write CS3 .tbl files. The pun is just a happy little accident.

warning: this is a work in progress, and the build system is bad.

it can read and write every table in the text folder except dat_en/t_quest.tbl, dat_en/t_name.tbl, and dat_fr/t_quest.tbl, with-identical output. however, many tables entries are still unstructured.

#build

linux only for now.

$ git clone --recursive https://git.sr.ht/~quf/libcs3tio
$ cd libcs3tio
$ sh compile.sh

This will compile the library, producing build/output/libcs3tio.a. To use the library, include src/cs3tio.h and add this archive to the linker input list.

#api

The main functions are:

  • Tbl load_tbl(std::istream &) to load a table.

  • void store_tbl(const Tbl&, std::ostream&) to store a table.

Tbl is a struct containing a vector of header names, and a std::vector<TableEntry>, where TableEntry is a large std::variant with different table entry types; for their definitions, see src/cs3tio.h.

#full build

This is only necessary for development of this library (i.e. to adapt it to new table schemata), not to simply use it in a depending program.

$ git submodule update
  • To get the most recent version of the schemata (for development/testing), run:
$ git submodule foreach git pull --ff-only

To regenerate the kaitai struct parser code, run:

$ cd ksp-src
$ sh make.sh

afterwards, update compile.sh and any source code as necessary, and do a normal build as described above.