Module Kaitai_of_data_encoding.Translate

module AnyEncoding : sig ... end

AnyEncoding allows to pack multiple encodings with incompatible types in the same data structure.

val escape_id : string -> string

escape_id id replaces special characters in id to obtain a string which is valid to use in kaitai-struct files' id fields.

val from_data_encoding : id:string -> ?extern:string AnyEncoding.Tbl.t -> 'a Data_encoding.t -> Kaitai.Types.ClassSpec.t

from_data_encoding ~id ?description encoding generates a formal description of encoding as a kaitai ClassSpec.

  • parameter [id]

    is escaped (no need to call escape_id) and added to the "meta" section of the class-spec.

  • parameter [extern]

    should contain all encodings that have their kaitai spec in a dedicated ksy file.