After a lot of time and effort, Kaitai project is happy to announce release of new major version of Kaitai Struct, declarative markup language to describe various binary data structures — binary file formats, network stream packets, etc.
The basic idea of Kaitai Struct is that a particular format can be
described using Kaitai Struct language (in a .ksy
file), which then
can be compiled using kaitai-struct-compiler
into source files in
one of the supported programming languages. These modules will include
a generated code for a parser that can read described data structure
from a file / stream and provide access to its contents in a nice,
easy-to-comprehend API.
With the previous 0.8 release, Kaitai project celebrated 1000 stars on GitHub, and until 0.9 version, it has collected more than 2000 stars. Thank you all for your support!
This version introduces C++11 target (which uses smart pointers),
several handy features (like valid
ations and little-endian bit integers),
fixes a lot of bugs and includes quite a few infrastructure improvements.
doc-ref
supports list of references (#269)meta/tags
allows specification of multiple tags to allow better navigation in the format gallery (#572)::
syntax: foo::bar
(#275)valid
key (#435)sizeof
and bitsizeof
operators (#84)
sizeof<u4>
, bitsizeof<b13>
, sizeof<user_type>
file_header._sizeof
(file_header
is a field defined in the current type)le
/ be
suffix: type: b12le
, type: b1be
meta/bit-endian
key for selecting default bit endianness (le
/ be
)src
for outputs of Go+Java anymore (#287). While this breaks existing builds most likely, it puts those languages in line with all others and adding subdirs is easier for the user than removing some added by Kaitai automatically.--debug
mode split into --no-auto-read
and --read-pos
(#332)--cpp-standard
CLI option: pass --cpp-standard 11
to enable C++11 mode (98
is default)#pragma once
(instead of #ifndef FOO_H_
header guards)std::unique_ptr<foo>
for owning pointers, raw pointers foo*
for non-owning--no-auto-read
implemented for C++Validation{Not{Equal,AnyOf},{Less,Greater}Than,Expr}Error
inheriting from common ancestor ValidationFailedError
- thrown on failed validations defined with valid
or contents
key (#435)read_bits_int_le
for parsing little-endian bit-sized integers (docs)ensure_fixed_contents
if
that asserts readBytes(n)
to be equal to the expected n
-byte array (throwing ValidationNotEqualError
if it fails)UnexpectedDataError
ValidationNotEqualError
read_bits_int
read_bits_int_be
params/type
- add support for:
enum
types (#413)bytes
)u2[]
, struct[]
, etc.)enum
with undefined values in enum list never crashes a parser (#523 for Python, #300 for Java)? :
) or array literalnot
cannot be used in expressions (#556)repeat: eos
(#548)_: foo
) only (#595)close()
(#497)--no-auto-read
mode (#204)namespace
declarations when no --php-namespace
specified (#637)