Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitai-bot committed Mar 18, 2024
1 parent 288fd43 commit 7710e2a
Show file tree
Hide file tree
Showing 82 changed files with 2,361 additions and 297 deletions.
10 changes: 10 additions & 0 deletions compiled/construct/nav_parent_recursive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from construct import *
from construct.lib import *

nav_parent_recursive = Struct(
'value' / Int8ub,
'next' / If(this.value == 255, LazyBound(lambda: nav_parent_recursive)),
'parent_value' / If(this.value != 255, Computed(lambda this: this._.value)),
)

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

nav_root_recursive = Struct(
'value' / Int8ub,
'next' / If(this.value == 255, LazyBound(lambda: nav_root_recursive)),
'root_value' / Computed(lambda this: this._root.value),
)

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

nested_types_import = Struct(
'a_cc' / LazyBound(lambda: nested_types3__subtype_a__subtype_cc),
'a_c_d' / LazyBound(lambda: nested_types3__subtype_a__subtype_c__subtype_d),
'b' / LazyBound(lambda: nested_types3__subtype_b),
)

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

params_call__my_str1 = Struct(
'body' / FixedSized(this.len, GreedyString(encoding='UTF-8')),
)

params_call__my_str2 = Struct(
'body' / FixedSized(this.len, GreedyString(encoding='UTF-8')),
'trailer' / If(this.has_trailer, Int8ub),
)

params_call = Struct(
'buf1' / LazyBound(lambda: params_call__my_str1),
'buf2' / LazyBound(lambda: params_call__my_str2),
)

_schema = params_call
18 changes: 0 additions & 18 deletions compiled/construct/params_call_short.py

This file was deleted.

41 changes: 41 additions & 0 deletions compiled/cpp_stl_11/nav_parent_recursive.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "nav_parent_recursive.h"

nav_parent_recursive_t::nav_parent_recursive_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, nav_parent_recursive_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
m_next = nullptr;
f_parent_value = false;
_read();
}

void nav_parent_recursive_t::_read() {
m_value = m__io->read_u1();
n_next = true;
if (value() == 255) {
n_next = false;
m_next = std::unique_ptr<nav_parent_recursive_t>(new nav_parent_recursive_t(m__io));
}
}

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

void nav_parent_recursive_t::_clean_up() {
if (!n_next) {
}
}

uint8_t nav_parent_recursive_t::parent_value() {
if (f_parent_value)
return m_parent_value;
n_parent_value = true;
if (value() != 255) {
n_parent_value = false;
m_parent_value = static_cast<nav_parent_recursive_t*>(_parent())->value();
}
f_parent_value = true;
return m_parent_value;
}
56 changes: 56 additions & 0 deletions compiled/cpp_stl_11/nav_parent_recursive.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#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 nav_parent_recursive_t : public kaitai::kstruct {

public:

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

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

public:
~nav_parent_recursive_t();

private:
bool f_parent_value;
uint8_t m_parent_value;
bool n_parent_value;

public:
bool _is_null_parent_value() { parent_value(); return n_parent_value; };

private:

public:
uint8_t parent_value();

private:
uint8_t m_value;
std::unique_ptr<nav_parent_recursive_t> m_next;
bool n_next;

public:
bool _is_null_next() { next(); return n_next; };

private:
nav_parent_recursive_t* m__root;
kaitai::kstruct* m__parent;

public:
uint8_t value() const { return m_value; }
nav_parent_recursive_t* next() const { return m_next.get(); }
nav_parent_recursive_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
37 changes: 37 additions & 0 deletions compiled/cpp_stl_11/nav_root_recursive.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "nav_root_recursive.h"

nav_root_recursive_t::nav_root_recursive_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, nav_root_recursive_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
m_next = nullptr;
f_root_value = false;
_read();
}

void nav_root_recursive_t::_read() {
m_value = m__io->read_u1();
n_next = true;
if (value() == 255) {
n_next = false;
m_next = std::unique_ptr<nav_root_recursive_t>(new nav_root_recursive_t(m__io));
}
}

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

void nav_root_recursive_t::_clean_up() {
if (!n_next) {
}
}

uint8_t nav_root_recursive_t::root_value() {
if (f_root_value)
return m_root_value;
m_root_value = _root()->value();
f_root_value = true;
return m_root_value;
}
50 changes: 50 additions & 0 deletions compiled/cpp_stl_11/nav_root_recursive.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#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 nav_root_recursive_t : public kaitai::kstruct {

public:

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

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

public:
~nav_root_recursive_t();

private:
bool f_root_value;
uint8_t m_root_value;

public:
uint8_t root_value();

private:
uint8_t m_value;
std::unique_ptr<nav_root_recursive_t> m_next;
bool n_next;

public:
bool _is_null_next() { next(); return n_next; };

private:
nav_root_recursive_t* m__root;
kaitai::kstruct* m__parent;

public:
uint8_t value() const { return m_value; }
nav_root_recursive_t* next() const { return m_next.get(); }
nav_root_recursive_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
2 changes: 1 addition & 1 deletion compiled/cpp_stl_11/nested_types3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ nested_types3_t::subtype_a_t::subtype_cc_t::~subtype_cc_t() {
void nested_types3_t::subtype_a_t::subtype_cc_t::_clean_up() {
}

nested_types3_t::subtype_b_t::subtype_b_t(kaitai::kstream* p__io, nested_types3_t* p__parent, nested_types3_t* p__root) : kaitai::kstruct(p__io) {
nested_types3_t::subtype_b_t::subtype_b_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, nested_types3_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = p__root;
m_a_cc = nullptr;
Expand Down
6 changes: 3 additions & 3 deletions compiled/cpp_stl_11/nested_types3.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class nested_types3_t : public kaitai::kstruct {

public:

subtype_b_t(kaitai::kstream* p__io, nested_types3_t* p__parent = nullptr, nested_types3_t* p__root = nullptr);
subtype_b_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, nested_types3_t* p__root = nullptr);

private:
void _read();
Expand All @@ -138,14 +138,14 @@ class nested_types3_t : public kaitai::kstruct {
std::unique_ptr<subtype_a_t::subtype_cc_t> m_a_cc;
std::unique_ptr<subtype_a_t::subtype_c_t::subtype_d_t> m_a_c_d;
nested_types3_t* m__root;
nested_types3_t* m__parent;
kaitai::kstruct* m__parent;

public:
int8_t value_b() const { return m_value_b; }
subtype_a_t::subtype_cc_t* a_cc() const { return m_a_cc.get(); }
subtype_a_t::subtype_c_t::subtype_d_t* a_c_d() const { return m_a_c_d.get(); }
nested_types3_t* _root() const { return m__root; }
nested_types3_t* _parent() const { return m__parent; }
kaitai::kstruct* _parent() const { return m__parent; }
};

private:
Expand Down
25 changes: 25 additions & 0 deletions compiled/cpp_stl_11/nested_types_import.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "nested_types_import.h"

nested_types_import_t::nested_types_import_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, nested_types_import_t* p__root) : kaitai::kstruct(p__io) {
m__parent = p__parent;
m__root = this;
m_a_cc = nullptr;
m_a_c_d = nullptr;
m_b = nullptr;
_read();
}

void nested_types_import_t::_read() {
m_a_cc = std::unique_ptr<nested_types3_t::subtype_a_t::subtype_cc_t>(new nested_types3_t::subtype_a_t::subtype_cc_t(m__io, this, m__root));
m_a_c_d = std::unique_ptr<nested_types3_t::subtype_a_t::subtype_c_t::subtype_d_t>(new nested_types3_t::subtype_a_t::subtype_c_t::subtype_d_t(m__io, this, m__root));
m_b = std::unique_ptr<nested_types3_t::subtype_b_t>(new nested_types3_t::subtype_b_t(m__io, this, m__root));
}

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

void nested_types_import_t::_clean_up() {
}
39 changes: 39 additions & 0 deletions compiled/cpp_stl_11/nested_types_import.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#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 nested_types_import_t : public kaitai::kstruct {

public:

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

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

public:
~nested_types_import_t();

private:
std::unique_ptr<nested_types3_t::subtype_a_t::subtype_cc_t> m_a_cc;
std::unique_ptr<nested_types3_t::subtype_a_t::subtype_c_t::subtype_d_t> m_a_c_d;
std::unique_ptr<nested_types3_t::subtype_b_t> m_b;
nested_types_import_t* m__root;
kaitai::kstruct* m__parent;

public:
nested_types3_t::subtype_a_t::subtype_cc_t* a_cc() const { return m_a_cc.get(); }
nested_types3_t::subtype_a_t::subtype_c_t::subtype_d_t* a_c_d() const { return m_a_c_d.get(); }
nested_types3_t::subtype_b_t* b() const { return m_b.get(); }
nested_types_import_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
Loading

0 comments on commit 7710e2a

Please sign in to comment.