Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitai-bot committed Apr 3, 2024
1 parent fdd5468 commit 24ec7d3
Show file tree
Hide file tree
Showing 248 changed files with 11,347 additions and 261 deletions.
3 changes: 1 addition & 2 deletions compiled/construct/cast_to_imported.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from construct.lib import *

cast_to_imported = Struct(
'one' / LazyBound(lambda: hello_world),
'one_casted' / Computed(lambda this: this.one),
'hw_one' / Computed(lambda this: this.hw_param.one),
)

_schema = cast_to_imported
8 changes: 8 additions & 0 deletions compiled/construct/cast_to_imported2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from construct import *
from construct.lib import *

cast_to_imported2 = Struct(
'hw' / Computed(lambda this: this.hw_param),
)

_schema = cast_to_imported2
10 changes: 10 additions & 0 deletions compiled/construct/enum_import_literals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from construct import *
from construct.lib import *

enum_import_literals = Struct(
'pet_1_eq' / Computed(lambda this: ('chicken' if True else 'dog') == 'chicken'),
'pet_1_to_i' / Computed(lambda this: int('cat')),
'pet_2' / Computed(lambda this: 'hare'),
)

_schema = enum_import_literals
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from construct import *
from construct.lib import *

enum_import = Struct(
enum_import_seq = Struct(
'pet_1' / Enum(Int32ul, enum_0__animal),
'pet_2' / Enum(Int32ul, enum_deep__container1__container2__animal),
)

_schema = enum_import
_schema = enum_import_seq
11 changes: 11 additions & 0 deletions compiled/construct/eof_exception_sized.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from construct import *
from construct.lib import *

eof_exception_sized__foo = Struct(
)

eof_exception_sized = Struct(
'buf' / FixedSized(13, LazyBound(lambda: eof_exception_sized__foo)),
)

_schema = eof_exception_sized
15 changes: 15 additions & 0 deletions compiled/construct/eos_exception_sized.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from construct import *
from construct.lib import *

eos_exception_sized__data = Struct(
'buf' / FixedSized(7, LazyBound(lambda: eos_exception_sized__foo)),
)

eos_exception_sized__foo = Struct(
)

eos_exception_sized = Struct(
'envelope' / FixedSized(6, LazyBound(lambda: eos_exception_sized__data)),
)

_schema = eos_exception_sized
9 changes: 9 additions & 0 deletions compiled/construct/imports_cast_to_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from construct import *
from construct.lib import *

imports_cast_to_imported = Struct(
'hw' / LazyBound(lambda: hello_world),
'two' / LazyBound(lambda: cast_to_imported),
)

_schema = imports_cast_to_imported
9 changes: 9 additions & 0 deletions compiled/construct/imports_cast_to_imported2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from construct import *
from construct.lib import *

imports_cast_to_imported2 = Struct(
'hw' / LazyBound(lambda: hello_world),
'two' / LazyBound(lambda: cast_to_imported2),
)

_schema = imports_cast_to_imported2
9 changes: 9 additions & 0 deletions compiled/construct/imports_params_def_enum_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from construct import *
from construct.lib import *

imports_params_def_enum_imported = Struct(
'one' / LazyBound(lambda: enum_import_seq),
'two' / LazyBound(lambda: params_def_enum_imported),
)

_schema = imports_params_def_enum_imported
9 changes: 9 additions & 0 deletions compiled/construct/imports_params_def_usertype_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from construct import *
from construct.lib import *

imports_params_def_usertype_imported = Struct(
'hw' / LazyBound(lambda: hello_world),
'two' / LazyBound(lambda: params_def_usertype_imported),
)

_schema = imports_params_def_usertype_imported
7 changes: 7 additions & 0 deletions compiled/construct/params_def_enum_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from construct import *
from construct.lib import *

params_def_enum_imported = Struct(
)

_schema = params_def_enum_imported
8 changes: 8 additions & 0 deletions compiled/construct/params_def_usertype_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from construct import *
from construct.lib import *

params_def_usertype_imported = Struct(
'hw_one' / Computed(lambda this: this.hw_param.one),
)

_schema = params_def_usertype_imported
31 changes: 31 additions & 0 deletions compiled/construct/str_encodings_escaping_enc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from construct import *
from construct.lib import *

str_encodings_escaping_enc__str1_wrapper = Struct(
'v' / Pointer(0, GreedyString(encoding='ASCII\\x')),
)

str_encodings_escaping_enc__str2_wrapper = Struct(
'v' / Pointer(0, GreedyString(encoding='UTF-8\'x')),
)

str_encodings_escaping_enc__str3_wrapper = Struct(
'v' / Pointer(0, GreedyString(encoding='SJIS\"x')),
)

str_encodings_escaping_enc__str4_wrapper = Struct(
'v' / Pointer(0, GreedyString(encoding='IBM437\nx')),
)

str_encodings_escaping_enc = Struct(
'len_of_1' / Int16ul,
'str1' / FixedSized(this.len_of_1, LazyBound(lambda: str_encodings_escaping_enc__str1_wrapper)),
'len_of_2' / Int16ul,
'str2' / FixedSized(this.len_of_2, LazyBound(lambda: str_encodings_escaping_enc__str2_wrapper)),
'len_of_3' / Int16ul,
'str3' / FixedSized(this.len_of_3, LazyBound(lambda: str_encodings_escaping_enc__str3_wrapper)),
'len_of_4' / Int16ul,
'str4' / FixedSized(this.len_of_4, LazyBound(lambda: str_encodings_escaping_enc__str4_wrapper)),
)

_schema = str_encodings_escaping_enc
19 changes: 19 additions & 0 deletions compiled/construct/str_encodings_escaping_to_s.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from construct import *
from construct.lib import *

str_encodings_escaping_to_s = Struct(
'len_of_1' / Int16ul,
'str1_raw' / FixedSized(this.len_of_1, GreedyBytes),
'len_of_2' / Int16ul,
'str2_raw' / FixedSized(this.len_of_2, GreedyBytes),
'len_of_3' / Int16ul,
'str3_raw' / FixedSized(this.len_of_3, GreedyBytes),
'len_of_4' / Int16ul,
'str4_raw' / FixedSized(this.len_of_4, GreedyBytes),
'str1' / Computed(lambda this: (this.str1_raw).decode("ASCII\\x")),
'str2' / Computed(lambda this: (this.str2_raw).decode("UTF-8\'x")),
'str3' / Computed(lambda this: (this.str3_raw).decode("SJIS\"x")),
'str4' / Computed(lambda this: (this.str4_raw).decode("IBM437\nx")),
)

_schema = str_encodings_escaping_to_s
19 changes: 9 additions & 10 deletions compiled/cpp_stl_11/cast_to_imported.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

#include "cast_to_imported.h"

cast_to_imported_t::cast_to_imported_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, cast_to_imported_t* p__root) : kaitai::kstruct(p__io) {
cast_to_imported_t::cast_to_imported_t(kaitai::kstruct* p_hw_param, kaitai::kstream* p__io, kaitai::kstruct* p__parent, cast_to_imported_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
m_one = nullptr;
f_one_casted = false;
m_hw_param = p_hw_param;
f_hw_one = false;
_read();
}

void cast_to_imported_t::_read() {
m_one = std::unique_ptr<hello_world_t>(new hello_world_t(m__io));
}

cast_to_imported_t::~cast_to_imported_t() {
Expand All @@ -21,10 +20,10 @@ cast_to_imported_t::~cast_to_imported_t() {
void cast_to_imported_t::_clean_up() {
}

hello_world_t* cast_to_imported_t::one_casted() {
if (f_one_casted)
return m_one_casted;
m_one_casted = static_cast<hello_world_t*>(one());
f_one_casted = true;
return m_one_casted;
uint8_t cast_to_imported_t::hw_one() {
if (f_hw_one)
return m_hw_one;
m_hw_one = static_cast<hello_world_t*>(hw_param())->one();
f_hw_one = true;
return m_hw_one;
}
14 changes: 6 additions & 8 deletions compiled/cpp_stl_11/cast_to_imported.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
#include "kaitai/kaitaistruct.h"
#include <stdint.h>
#include <memory>
#include "hello_world.h"

#if KAITAI_STRUCT_VERSION < 11000L
#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required"
#endif
class hello_world_t;

class cast_to_imported_t : public kaitai::kstruct {

public:

cast_to_imported_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, cast_to_imported_t* p__root = nullptr);
cast_to_imported_t(kaitai::kstruct* p_hw_param, kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, cast_to_imported_t* p__root = nullptr);

private:
void _read();
Expand All @@ -26,19 +24,19 @@ class cast_to_imported_t : public kaitai::kstruct {
~cast_to_imported_t();

private:
bool f_one_casted;
hello_world_t* m_one_casted;
bool f_hw_one;
uint8_t m_hw_one;

public:
hello_world_t* one_casted();
uint8_t hw_one();

private:
std::unique_ptr<hello_world_t> m_one;
kaitai::kstruct* m_hw_param;
cast_to_imported_t* m__root;
kaitai::kstruct* m__parent;

public:
hello_world_t* one() const { return m_one.get(); }
kaitai::kstruct* hw_param() const { return m_hw_param; }
cast_to_imported_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
29 changes: 29 additions & 0 deletions compiled/cpp_stl_11/cast_to_imported2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "cast_to_imported2.h"

cast_to_imported2_t::cast_to_imported2_t(kaitai::kstruct* p_hw_param, kaitai::kstream* p__io, kaitai::kstruct* p__parent, cast_to_imported2_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
m_hw_param = p_hw_param;
f_hw = false;
_read();
}

void cast_to_imported2_t::_read() {
}

cast_to_imported2_t::~cast_to_imported2_t() {
_clean_up();
}

void cast_to_imported2_t::_clean_up() {
}

hello_world_t* cast_to_imported2_t::hw() {
if (f_hw)
return m_hw;
m_hw = static_cast<hello_world_t*>(hw_param());
f_hw = true;
return m_hw;
}
42 changes: 42 additions & 0 deletions compiled/cpp_stl_11/cast_to_imported2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once

// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "kaitai/kaitaistruct.h"
#include <stdint.h>
#include <memory>

#if KAITAI_STRUCT_VERSION < 11000L
#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required"
#endif

class cast_to_imported2_t : public kaitai::kstruct {

public:

cast_to_imported2_t(kaitai::kstruct* p_hw_param, kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, cast_to_imported2_t* p__root = nullptr);

private:
void _read();
void _clean_up();

public:
~cast_to_imported2_t();

private:
bool f_hw;
hello_world_t* m_hw;

public:
hello_world_t* hw();

private:
kaitai::kstruct* m_hw_param;
cast_to_imported2_t* m__root;
kaitai::kstruct* m__parent;

public:
kaitai::kstruct* hw_param() const { return m_hw_param; }
cast_to_imported2_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
46 changes: 46 additions & 0 deletions compiled/cpp_stl_11/enum_import_literals.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "enum_import_literals.h"

enum_import_literals_t::enum_import_literals_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, enum_import_literals_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
f_pet_1_eq = false;
f_pet_1_to_i = false;
f_pet_2 = false;
_read();
}

void enum_import_literals_t::_read() {
}

enum_import_literals_t::~enum_import_literals_t() {
_clean_up();
}

void enum_import_literals_t::_clean_up() {
}

bool enum_import_literals_t::pet_1_eq() {
if (f_pet_1_eq)
return m_pet_1_eq;
m_pet_1_eq = ((true) ? (enum_0_t::ANIMAL_CHICKEN) : (enum_0_t::ANIMAL_DOG)) == enum_0_t::ANIMAL_CHICKEN;
f_pet_1_eq = true;
return m_pet_1_eq;
}

int32_t enum_import_literals_t::pet_1_to_i() {
if (f_pet_1_to_i)
return m_pet_1_to_i;
m_pet_1_to_i = enum_0_t::ANIMAL_CAT;
f_pet_1_to_i = true;
return m_pet_1_to_i;
}

enum_deep_t::container1_t::container2_t::animal_t enum_import_literals_t::pet_2() {
if (f_pet_2)
return m_pet_2;
m_pet_2 = enum_deep_t::container1_t::container2_t::ANIMAL_HARE;
f_pet_2 = true;
return m_pet_2;
}
Loading

0 comments on commit 24ec7d3

Please sign in to comment.