From 3245b960449d2db32be7bbf660d52c15b7b01bb9 Mon Sep 17 00:00:00 2001 From: Kaitai Bot Date: Wed, 7 Aug 2024 14:01:42 +0000 Subject: [PATCH] Regen master kaitai-io/kaitai_struct@a8afea8ef9f202bbd2687377e0921514d4fc451f --- compiled/construct/bytes_pad_term.py | 6 +- compiled/construct/cast_nested.py | 2 +- compiled/construct/combine_bytes.py | 2 +- compiled/construct/combine_str.py | 2 +- compiled/construct/expr_array.py | 2 +- compiled/construct/expr_io_pos.py | 2 +- compiled/construct/instance_io_user.py | 4 +- .../construct/nav_parent_vs_value_inst.py | 2 +- .../opaque_external_type_02_child.py | 6 +- compiled/construct/position_abs.py | 2 +- compiled/construct/repeat_n_strz.py | 2 +- compiled/construct/repeat_n_strz_double.py | 4 +- compiled/construct/repeat_until_s4.py | 2 +- compiled/construct/str_pad_term.py | 6 +- compiled/construct/str_pad_term_empty.py | 6 +- compiled/construct/str_pad_term_utf16.py | 10 + compiled/construct/switch_bytearray.py | 2 +- compiled/construct/switch_cast.py | 2 +- compiled/construct/switch_manual_enum.py | 2 +- .../construct/switch_manual_enum_invalid.py | 2 +- .../switch_manual_enum_invalid_else.py | 2 +- compiled/construct/switch_manual_int.py | 2 +- compiled/construct/switch_manual_int_else.py | 2 +- compiled/construct/switch_manual_int_size.py | 4 +- .../construct/switch_manual_int_size_else.py | 4 +- .../construct/switch_manual_int_size_eos.py | 4 +- compiled/construct/switch_manual_str.py | 2 +- compiled/construct/switch_manual_str_else.py | 2 +- compiled/construct/term_bytes.py | 6 +- compiled/construct/term_strz.py | 6 +- compiled/construct/term_strz_utf16_v1.py | 11 + compiled/construct/term_strz_utf16_v2.py | 10 + compiled/construct/term_strz_utf16_v3.py | 11 + compiled/construct/term_strz_utf16_v4.py | 24 ++ compiled/construct/term_u1_val.py | 4 +- compiled/construct/to_string_custom.py | 4 +- .../construct/valid_fail_repeat_anyof_int.py | 8 + .../construct/valid_fail_repeat_contents.py | 8 + .../construct/valid_fail_repeat_eq_int.py | 8 + compiled/construct/valid_fail_repeat_expr.py | 8 + compiled/construct/valid_fail_repeat_inst.py | 9 + .../construct/valid_fail_repeat_max_int.py | 8 + .../construct/valid_fail_repeat_min_int.py | 8 + compiled/cpp_stl_11/fixed_contents.cpp | 8 +- compiled/cpp_stl_11/fixed_struct.cpp | 28 +-- compiled/cpp_stl_11/integers.cpp | 28 +-- compiled/cpp_stl_11/str_pad_term_utf16.cpp | 22 ++ compiled/cpp_stl_11/str_pad_term_utf16.h | 41 ++++ compiled/cpp_stl_11/term_strz_utf16_v1.cpp | 23 ++ compiled/cpp_stl_11/term_strz_utf16_v1.h | 43 ++++ compiled/cpp_stl_11/term_strz_utf16_v2.cpp | 22 ++ compiled/cpp_stl_11/term_strz_utf16_v2.h | 41 ++++ compiled/cpp_stl_11/term_strz_utf16_v3.cpp | 23 ++ compiled/cpp_stl_11/term_strz_utf16_v3.h | 43 ++++ compiled/cpp_stl_11/term_strz_utf16_v4.cpp | 87 ++++++++ compiled/cpp_stl_11/term_strz_utf16_v4.h | 132 +++++++++++ .../cpp_stl_11/valid_eq_str_encodings.cpp | 16 +- compiled/cpp_stl_11/valid_fail_anyof_int.cpp | 4 +- compiled/cpp_stl_11/valid_fail_contents.cpp | 4 +- compiled/cpp_stl_11/valid_fail_eq_bytes.cpp | 4 +- compiled/cpp_stl_11/valid_fail_eq_int.cpp | 4 +- compiled/cpp_stl_11/valid_fail_eq_str.cpp | 4 +- compiled/cpp_stl_11/valid_fail_expr.cpp | 8 +- compiled/cpp_stl_11/valid_fail_inst.cpp | 6 +- compiled/cpp_stl_11/valid_fail_max_int.cpp | 4 +- compiled/cpp_stl_11/valid_fail_min_int.cpp | 4 +- .../cpp_stl_11/valid_fail_range_bytes.cpp | 8 +- .../cpp_stl_11/valid_fail_range_float.cpp | 8 +- compiled/cpp_stl_11/valid_fail_range_int.cpp | 8 +- compiled/cpp_stl_11/valid_fail_range_str.cpp | 8 +- .../valid_fail_repeat_anyof_int.cpp | 32 +++ .../cpp_stl_11/valid_fail_repeat_anyof_int.h | 38 ++++ .../cpp_stl_11/valid_fail_repeat_contents.cpp | 32 +++ .../cpp_stl_11/valid_fail_repeat_contents.h | 38 ++++ .../cpp_stl_11/valid_fail_repeat_eq_int.cpp | 32 +++ .../cpp_stl_11/valid_fail_repeat_eq_int.h | 38 ++++ .../cpp_stl_11/valid_fail_repeat_expr.cpp | 35 +++ compiled/cpp_stl_11/valid_fail_repeat_expr.h | 38 ++++ .../cpp_stl_11/valid_fail_repeat_inst.cpp | 52 +++++ compiled/cpp_stl_11/valid_fail_repeat_inst.h | 51 +++++ .../cpp_stl_11/valid_fail_repeat_max_int.cpp | 32 +++ .../cpp_stl_11/valid_fail_repeat_max_int.h | 38 ++++ .../cpp_stl_11/valid_fail_repeat_min_int.cpp | 32 +++ .../cpp_stl_11/valid_fail_repeat_min_int.h | 38 ++++ compiled/cpp_stl_11/valid_long.cpp | 44 ++-- compiled/cpp_stl_11/valid_not_parsed_if.cpp | 8 +- compiled/cpp_stl_11/valid_optional_id.cpp | 12 +- compiled/cpp_stl_11/valid_short.cpp | 44 ++-- compiled/cpp_stl_11/valid_switch.cpp | 8 +- compiled/cpp_stl_98/fixed_contents.cpp | 8 +- compiled/cpp_stl_98/fixed_struct.cpp | 28 +-- compiled/cpp_stl_98/integers.cpp | 28 +-- compiled/cpp_stl_98/str_pad_term_utf16.cpp | 28 +++ compiled/cpp_stl_98/str_pad_term_utf16.h | 43 ++++ compiled/cpp_stl_98/term_strz_utf16_v1.cpp | 29 +++ compiled/cpp_stl_98/term_strz_utf16_v1.h | 45 ++++ compiled/cpp_stl_98/term_strz_utf16_v2.cpp | 28 +++ compiled/cpp_stl_98/term_strz_utf16_v2.h | 43 ++++ compiled/cpp_stl_98/term_strz_utf16_v3.cpp | 29 +++ compiled/cpp_stl_98/term_strz_utf16_v3.h | 45 ++++ compiled/cpp_stl_98/term_strz_utf16_v4.cpp | 129 +++++++++++ compiled/cpp_stl_98/term_strz_utf16_v4.h | 134 ++++++++++++ .../cpp_stl_98/valid_eq_str_encodings.cpp | 16 +- compiled/cpp_stl_98/valid_fail_anyof_int.cpp | 4 +- compiled/cpp_stl_98/valid_fail_contents.cpp | 4 +- compiled/cpp_stl_98/valid_fail_eq_bytes.cpp | 4 +- compiled/cpp_stl_98/valid_fail_eq_int.cpp | 4 +- compiled/cpp_stl_98/valid_fail_eq_str.cpp | 4 +- compiled/cpp_stl_98/valid_fail_expr.cpp | 8 +- compiled/cpp_stl_98/valid_fail_inst.cpp | 6 +- compiled/cpp_stl_98/valid_fail_max_int.cpp | 4 +- compiled/cpp_stl_98/valid_fail_min_int.cpp | 4 +- .../cpp_stl_98/valid_fail_range_bytes.cpp | 8 +- .../cpp_stl_98/valid_fail_range_float.cpp | 8 +- compiled/cpp_stl_98/valid_fail_range_int.cpp | 8 +- compiled/cpp_stl_98/valid_fail_range_str.cpp | 8 +- .../valid_fail_repeat_anyof_int.cpp | 41 ++++ .../cpp_stl_98/valid_fail_repeat_anyof_int.h | 40 ++++ .../cpp_stl_98/valid_fail_repeat_contents.cpp | 41 ++++ .../cpp_stl_98/valid_fail_repeat_contents.h | 40 ++++ .../cpp_stl_98/valid_fail_repeat_eq_int.cpp | 41 ++++ .../cpp_stl_98/valid_fail_repeat_eq_int.h | 40 ++++ .../cpp_stl_98/valid_fail_repeat_expr.cpp | 44 ++++ compiled/cpp_stl_98/valid_fail_repeat_expr.h | 40 ++++ .../cpp_stl_98/valid_fail_repeat_inst.cpp | 61 ++++++ compiled/cpp_stl_98/valid_fail_repeat_inst.h | 53 +++++ .../cpp_stl_98/valid_fail_repeat_max_int.cpp | 41 ++++ .../cpp_stl_98/valid_fail_repeat_max_int.h | 40 ++++ .../cpp_stl_98/valid_fail_repeat_min_int.cpp | 41 ++++ .../cpp_stl_98/valid_fail_repeat_min_int.h | 40 ++++ compiled/cpp_stl_98/valid_long.cpp | 44 ++-- compiled/cpp_stl_98/valid_not_parsed_if.cpp | 8 +- compiled/cpp_stl_98/valid_optional_id.cpp | 12 +- compiled/cpp_stl_98/valid_short.cpp | 44 ++-- compiled/cpp_stl_98/valid_switch.cpp | 8 +- compiled/csharp/FixedContents.cs | 8 +- compiled/csharp/FixedStruct.cs | 28 +-- compiled/csharp/Integers.cs | 28 +-- compiled/csharp/StrPadTermUtf16.cs | 37 ++++ compiled/csharp/TermStrzUtf16V1.cs | 40 ++++ compiled/csharp/TermStrzUtf16V2.cs | 37 ++++ compiled/csharp/TermStrzUtf16V3.cs | 40 ++++ compiled/csharp/TermStrzUtf16V4.cs | 127 +++++++++++ compiled/csharp/ValidEqStrEncodings.cs | 16 +- compiled/csharp/ValidFailAnyofInt.cs | 4 +- compiled/csharp/ValidFailContents.cs | 4 +- compiled/csharp/ValidFailEqBytes.cs | 4 +- compiled/csharp/ValidFailEqInt.cs | 4 +- compiled/csharp/ValidFailEqStr.cs | 4 +- compiled/csharp/ValidFailExpr.cs | 8 +- compiled/csharp/ValidFailInst.cs | 8 +- compiled/csharp/ValidFailMaxInt.cs | 4 +- compiled/csharp/ValidFailMinInt.cs | 4 +- compiled/csharp/ValidFailRangeBytes.cs | 8 +- compiled/csharp/ValidFailRangeFloat.cs | 8 +- compiled/csharp/ValidFailRangeInt.cs | 8 +- compiled/csharp/ValidFailRangeStr.cs | 8 +- compiled/csharp/ValidFailRepeatAnyofInt.cs | 42 ++++ compiled/csharp/ValidFailRepeatContents.cs | 42 ++++ compiled/csharp/ValidFailRepeatEqInt.cs | 42 ++++ compiled/csharp/ValidFailRepeatExpr.cs | 45 ++++ compiled/csharp/ValidFailRepeatInst.cs | 61 ++++++ compiled/csharp/ValidFailRepeatMaxInt.cs | 42 ++++ compiled/csharp/ValidFailRepeatMinInt.cs | 42 ++++ compiled/csharp/ValidLong.cs | 44 ++-- compiled/csharp/ValidNotParsedIf.cs | 8 +- compiled/csharp/ValidOptionalId.cs | 12 +- compiled/csharp/ValidShort.cs | 44 ++-- compiled/csharp/ValidSwitch.cs | 8 +- .../default_endian_expr_exception.go | 2 +- .../default_endian_expr_inherited.go | 2 +- .../test_formats/default_endian_expr_is_be.go | 2 +- .../test_formats/default_endian_expr_is_le.go | 2 +- .../go/src/test_formats/index_to_param_eos.go | 2 +- .../go/src/test_formats/instance_io_user.go | 2 +- .../go/src/test_formats/repeat_eos_bit.go | 2 +- .../go/src/test_formats/repeat_eos_struct.go | 2 +- compiled/go/src/test_formats/repeat_eos_u4.go | 2 +- .../go/src/test_formats/str_pad_term_utf16.go | 63 ++++++ .../go/src/test_formats/switch_bytearray.go | 2 +- .../go/src/test_formats/switch_integers.go | 2 +- .../go/src/test_formats/switch_manual_enum.go | 2 +- .../switch_manual_enum_invalid.go | 2 +- .../switch_manual_enum_invalid_else.go | 2 +- .../go/src/test_formats/switch_manual_int.go | 2 +- .../test_formats/switch_manual_int_else.go | 2 +- .../test_formats/switch_manual_int_size.go | 4 +- .../switch_manual_int_size_else.go | 4 +- .../switch_manual_int_size_eos.go | 4 +- .../go/src/test_formats/switch_manual_str.go | 2 +- .../test_formats/switch_manual_str_else.go | 2 +- .../src/test_formats/switch_multi_bool_ops.go | 2 +- .../go/src/test_formats/term_strz_utf16_v1.go | 66 ++++++ .../go/src/test_formats/term_strz_utf16_v2.go | 60 +++++ .../go/src/test_formats/term_strz_utf16_v3.go | 66 ++++++ .../go/src/test_formats/term_strz_utf16_v4.go | 183 ++++++++++++++++ .../go/src/test_formats/valid_fail_inst.go | 14 +- .../valid_fail_repeat_anyof_int.go | 45 ++++ .../valid_fail_repeat_contents.go | 49 +++++ .../test_formats/valid_fail_repeat_eq_int.go | 45 ++++ .../test_formats/valid_fail_repeat_expr.go | 52 +++++ .../test_formats/valid_fail_repeat_inst.go | 82 +++++++ .../test_formats/valid_fail_repeat_max_int.go | 45 ++++ .../test_formats/valid_fail_repeat_min_int.go | 45 ++++ compiled/graphviz/expr_array.dot | 2 +- compiled/graphviz/expr_io_pos.dot | 2 +- compiled/graphviz/instance_io_user.dot | 4 +- compiled/graphviz/position_abs.dot | 2 +- compiled/graphviz/repeat_n_strz.dot | 2 +- compiled/graphviz/repeat_n_strz_double.dot | 4 +- compiled/graphviz/repeat_until_s4.dot | 2 +- compiled/graphviz/str_pad_term_utf16.dot | 15 ++ compiled/graphviz/switch_bytearray.dot | 2 +- compiled/graphviz/switch_manual_enum.dot | 2 +- .../graphviz/switch_manual_enum_invalid.dot | 2 +- .../switch_manual_enum_invalid_else.dot | 2 +- compiled/graphviz/switch_manual_int.dot | 2 +- compiled/graphviz/switch_manual_int_else.dot | 2 +- compiled/graphviz/switch_manual_int_size.dot | 4 +- .../graphviz/switch_manual_int_size_else.dot | 4 +- .../graphviz/switch_manual_int_size_eos.dot | 4 +- compiled/graphviz/switch_manual_str.dot | 2 +- compiled/graphviz/switch_manual_str_else.dot | 2 +- compiled/graphviz/term_strz_utf16_v1.dot | 16 ++ compiled/graphviz/term_strz_utf16_v2.dot | 15 ++ compiled/graphviz/term_strz_utf16_v3.dot | 16 ++ compiled/graphviz/term_strz_utf16_v4.dot | 47 ++++ .../graphviz/valid_fail_repeat_anyof_int.dot | 14 ++ .../graphviz/valid_fail_repeat_contents.dot | 14 ++ .../graphviz/valid_fail_repeat_eq_int.dot | 14 ++ compiled/graphviz/valid_fail_repeat_expr.dot | 14 ++ compiled/graphviz/valid_fail_repeat_inst.dot | 18 ++ .../graphviz/valid_fail_repeat_max_int.dot | 14 ++ .../graphviz/valid_fail_repeat_min_int.dot | 14 ++ compiled/html/cast_nested.html | 4 +- compiled/html/expr_array.html | 10 +- compiled/html/expr_io_pos.html | 2 +- compiled/html/instance_io_user.html | 4 +- compiled/html/position_abs.html | 2 +- compiled/html/repeat_n_strz.html | 2 +- compiled/html/repeat_n_strz_double.html | 4 +- compiled/html/repeat_until_s4.html | 2 +- compiled/html/str_pad_term_utf16.html | 55 +++++ compiled/html/switch_bytearray.html | 2 +- compiled/html/switch_cast.html | 2 +- compiled/html/switch_manual_enum.html | 2 +- compiled/html/switch_manual_enum_invalid.html | 2 +- .../html/switch_manual_enum_invalid_else.html | 2 +- compiled/html/switch_manual_int.html | 2 +- compiled/html/switch_manual_int_else.html | 2 +- compiled/html/switch_manual_int_size.html | 4 +- .../html/switch_manual_int_size_else.html | 4 +- compiled/html/switch_manual_int_size_eos.html | 4 +- compiled/html/switch_manual_str.html | 2 +- compiled/html/switch_manual_str_else.html | 2 +- compiled/html/term_strz_utf16_v1.html | 62 ++++++ compiled/html/term_strz_utf16_v2.html | 55 +++++ compiled/html/term_strz_utf16_v3.html | 62 ++++++ compiled/html/term_strz_utf16_v4.html | 108 +++++++++ .../html/valid_fail_repeat_anyof_int.html | 41 ++++ compiled/html/valid_fail_repeat_contents.html | 41 ++++ compiled/html/valid_fail_repeat_eq_int.html | 41 ++++ compiled/html/valid_fail_repeat_expr.html | 41 ++++ compiled/html/valid_fail_repeat_inst.html | 51 +++++ compiled/html/valid_fail_repeat_max_int.html | 41 ++++ compiled/html/valid_fail_repeat_min_int.html | 41 ++++ .../struct/testformats/FixedContents.java | 8 +- .../struct/testformats/FixedStruct.java | 28 +-- .../kaitai/struct/testformats/Integers.java | 28 +-- .../struct/testformats/StrPadTermUtf16.java | 45 ++++ .../struct/testformats/TermStrzUtf16V1.java | 48 ++++ .../struct/testformats/TermStrzUtf16V2.java | 45 ++++ .../struct/testformats/TermStrzUtf16V3.java | 48 ++++ .../struct/testformats/TermStrzUtf16V4.java | 141 ++++++++++++ .../testformats/ValidEqStrEncodings.java | 16 +- .../struct/testformats/ValidFailAnyofInt.java | 4 +- .../struct/testformats/ValidFailContents.java | 4 +- .../struct/testformats/ValidFailEqBytes.java | 4 +- .../struct/testformats/ValidFailEqInt.java | 4 +- .../struct/testformats/ValidFailEqStr.java | 4 +- .../struct/testformats/ValidFailExpr.java | 8 +- .../struct/testformats/ValidFailInst.java | 6 +- .../struct/testformats/ValidFailMaxInt.java | 4 +- .../struct/testformats/ValidFailMinInt.java | 4 +- .../testformats/ValidFailRangeBytes.java | 8 +- .../testformats/ValidFailRangeFloat.java | 8 +- .../struct/testformats/ValidFailRangeInt.java | 8 +- .../struct/testformats/ValidFailRangeStr.java | 8 +- .../testformats/ValidFailRepeatAnyofInt.java | 49 +++++ .../testformats/ValidFailRepeatContents.java | 50 +++++ .../testformats/ValidFailRepeatEqInt.java | 49 +++++ .../testformats/ValidFailRepeatExpr.java | 53 +++++ .../testformats/ValidFailRepeatInst.java | 61 ++++++ .../testformats/ValidFailRepeatMaxInt.java | 49 +++++ .../testformats/ValidFailRepeatMinInt.java | 49 +++++ .../kaitai/struct/testformats/ValidLong.java | 44 ++-- .../struct/testformats/ValidNotParsedIf.java | 8 +- .../struct/testformats/ValidOptionalId.java | 12 +- .../kaitai/struct/testformats/ValidShort.java | 44 ++-- .../struct/testformats/ValidSwitch.java | 8 +- compiled/javascript/StrPadTermUtf16.js | 29 +++ compiled/javascript/TermStrzUtf16V1.js | 30 +++ compiled/javascript/TermStrzUtf16V2.js | 29 +++ compiled/javascript/TermStrzUtf16V3.js | 30 +++ compiled/javascript/TermStrzUtf16V4.js | 82 +++++++ compiled/javascript/ValidFailInst.js | 6 +- .../javascript/ValidFailRepeatAnyofInt.js | 35 +++ .../javascript/ValidFailRepeatContents.js | 35 +++ compiled/javascript/ValidFailRepeatEqInt.js | 35 +++ compiled/javascript/ValidFailRepeatExpr.js | 36 +++ compiled/javascript/ValidFailRepeatInst.js | 48 ++++ compiled/javascript/ValidFailRepeatMaxInt.js | 35 +++ compiled/javascript/ValidFailRepeatMinInt.js | 35 +++ compiled/lua/str_pad_term_utf16.lua | 24 ++ compiled/lua/term_strz_utf16_v1.lua | 25 +++ compiled/lua/term_strz_utf16_v2.lua | 24 ++ compiled/lua/term_strz_utf16_v3.lua | 25 +++ compiled/lua/term_strz_utf16_v4.lua | 75 +++++++ compiled/lua/valid_fail_inst.lua | 6 +- compiled/lua/valid_fail_repeat_anyof_int.lua | 29 +++ compiled/lua/valid_fail_repeat_contents.lua | 29 +++ compiled/lua/valid_fail_repeat_eq_int.lua | 29 +++ compiled/lua/valid_fail_repeat_expr.lua | 30 +++ compiled/lua/valid_fail_repeat_inst.lua | 44 ++++ compiled/lua/valid_fail_repeat_max_int.lua | 29 +++ compiled/lua/valid_fail_repeat_min_int.lua | 29 +++ compiled/nim/str_pad_term_utf16.nim | 31 +++ compiled/nim/term_strz_utf16_v1.nim | 34 +++ compiled/nim/term_strz_utf16_v2.nim | 31 +++ compiled/nim/term_strz_utf16_v3.nim | 34 +++ compiled/nim/term_strz_utf16_v4.nim | 103 +++++++++ compiled/nim/valid_fail_repeat_anyof_int.nim | 29 +++ compiled/nim/valid_fail_repeat_contents.nim | 29 +++ compiled/nim/valid_fail_repeat_eq_int.nim | 29 +++ compiled/nim/valid_fail_repeat_inst.nim | 44 ++++ compiled/nim/valid_fail_repeat_max_int.nim | 29 +++ compiled/nim/valid_fail_repeat_min_int.nim | 29 +++ compiled/perl/StrPadTermUtf16.pm | 58 +++++ compiled/perl/TermStrzUtf16V1.pm | 64 ++++++ compiled/perl/TermStrzUtf16V2.pm | 58 +++++ compiled/perl/TermStrzUtf16V3.pm | 64 ++++++ compiled/perl/TermStrzUtf16V4.pm | 205 ++++++++++++++++++ compiled/perl/ValidFailRepeatAnyofInt.pm | 48 ++++ compiled/perl/ValidFailRepeatContents.pm | 48 ++++ compiled/perl/ValidFailRepeatEqInt.pm | 48 ++++ compiled/perl/ValidFailRepeatInst.pm | 60 +++++ compiled/perl/ValidFailRepeatMaxInt.pm | 48 ++++ compiled/perl/ValidFailRepeatMinInt.pm | 48 ++++ compiled/php/FixedContents.php | 8 +- compiled/php/FixedStruct.php | 28 +-- compiled/php/Integers.php | 28 +-- compiled/php/StrPadTermUtf16.php | 23 ++ compiled/php/TermStrzUtf16V1.php | 26 +++ compiled/php/TermStrzUtf16V2.php | 23 ++ compiled/php/TermStrzUtf16V3.php | 26 +++ compiled/php/TermStrzUtf16V4.php | 86 ++++++++ compiled/php/ValidEqStrEncodings.php | 16 +- compiled/php/ValidFailAnyofInt.php | 4 +- compiled/php/ValidFailContents.php | 4 +- compiled/php/ValidFailEqBytes.php | 4 +- compiled/php/ValidFailEqInt.php | 4 +- compiled/php/ValidFailEqStr.php | 4 +- compiled/php/ValidFailExpr.php | 8 +- compiled/php/ValidFailInst.php | 6 +- compiled/php/ValidFailMaxInt.php | 4 +- compiled/php/ValidFailMinInt.php | 4 +- compiled/php/ValidFailRangeBytes.php | 8 +- compiled/php/ValidFailRangeFloat.php | 8 +- compiled/php/ValidFailRangeInt.php | 8 +- compiled/php/ValidFailRangeStr.php | 8 +- compiled/php/ValidFailRepeatAnyofInt.php | 25 +++ compiled/php/ValidFailRepeatContents.php | 25 +++ compiled/php/ValidFailRepeatEqInt.php | 25 +++ compiled/php/ValidFailRepeatExpr.php | 26 +++ compiled/php/ValidFailRepeatInst.php | 37 ++++ compiled/php/ValidFailRepeatMaxInt.php | 25 +++ compiled/php/ValidFailRepeatMinInt.php | 25 +++ compiled/php/ValidLong.php | 44 ++-- compiled/php/ValidNotParsedIf.php | 8 +- compiled/php/ValidOptionalId.php | 12 +- compiled/php/ValidShort.php | 44 ++-- compiled/php/ValidSwitch.php | 8 +- compiled/python/str_pad_term_utf16.py | 23 ++ compiled/python/term_strz_utf16_v1.py | 24 ++ compiled/python/term_strz_utf16_v2.py | 23 ++ compiled/python/term_strz_utf16_v3.py | 24 ++ compiled/python/term_strz_utf16_v4.py | 64 ++++++ compiled/python/valid_fail_inst.py | 4 +- .../python/valid_fail_repeat_anyof_int.py | 28 +++ compiled/python/valid_fail_repeat_contents.py | 28 +++ compiled/python/valid_fail_repeat_eq_int.py | 28 +++ compiled/python/valid_fail_repeat_expr.py | 29 +++ compiled/python/valid_fail_repeat_inst.py | 41 ++++ compiled/python/valid_fail_repeat_max_int.py | 28 +++ compiled/python/valid_fail_repeat_min_int.py | 28 +++ compiled/ruby/fixed_contents.rb | 4 +- compiled/ruby/fixed_struct.rb | 14 +- compiled/ruby/integers.rb | 14 +- compiled/ruby/str_pad_term_utf16.rb | 24 ++ compiled/ruby/term_strz_utf16_v1.rb | 26 +++ compiled/ruby/term_strz_utf16_v2.rb | 24 ++ compiled/ruby/term_strz_utf16_v3.rb | 26 +++ compiled/ruby/term_strz_utf16_v4.rb | 70 ++++++ compiled/ruby/valid_eq_str_encodings.rb | 8 +- compiled/ruby/valid_fail_anyof_int.rb | 2 +- compiled/ruby/valid_fail_contents.rb | 2 +- compiled/ruby/valid_fail_eq_bytes.rb | 2 +- compiled/ruby/valid_fail_eq_int.rb | 2 +- compiled/ruby/valid_fail_eq_str.rb | 2 +- compiled/ruby/valid_fail_expr.rb | 8 +- compiled/ruby/valid_fail_inst.rb | 2 +- compiled/ruby/valid_fail_max_int.rb | 2 +- compiled/ruby/valid_fail_min_int.rb | 2 +- compiled/ruby/valid_fail_range_bytes.rb | 4 +- compiled/ruby/valid_fail_range_float.rb | 4 +- compiled/ruby/valid_fail_range_int.rb | 4 +- compiled/ruby/valid_fail_range_str.rb | 4 +- compiled/ruby/valid_fail_repeat_anyof_int.rb | 26 +++ compiled/ruby/valid_fail_repeat_contents.rb | 26 +++ compiled/ruby/valid_fail_repeat_eq_int.rb | 26 +++ compiled/ruby/valid_fail_repeat_expr.rb | 27 +++ compiled/ruby/valid_fail_repeat_inst.rb | 36 +++ compiled/ruby/valid_fail_repeat_max_int.rb | 26 +++ compiled/ruby/valid_fail_repeat_min_int.rb | 26 +++ compiled/ruby/valid_long.rb | 22 +- compiled/ruby/valid_not_parsed_if.rb | 4 +- compiled/ruby/valid_optional_id.rb | 8 +- compiled/ruby/valid_short.rb | 22 +- compiled/ruby/valid_switch.rb | 4 +- compiled/rust/str_pad_term_utf16.rs | 47 ++++ compiled/rust/term_strz_utf16_v1.rs | 49 +++++ compiled/rust/term_strz_utf16_v2.rs | 47 ++++ compiled/rust/term_strz_utf16_v3.rs | 49 +++++ compiled/rust/term_strz_utf16_v4.rs | 156 +++++++++++++ compiled/rust/valid_fail_repeat_anyof_int.rs | 46 ++++ compiled/rust/valid_fail_repeat_contents.rs | 46 ++++ compiled/rust/valid_fail_repeat_eq_int.rs | 46 ++++ compiled/rust/valid_fail_repeat_inst.rs | 60 +++++ compiled/rust/valid_fail_repeat_max_int.rs | 46 ++++ compiled/rust/valid_fail_repeat_min_int.rs | 46 ++++ 440 files changed, 9865 insertions(+), 893 deletions(-) create mode 100644 compiled/construct/str_pad_term_utf16.py create mode 100644 compiled/construct/term_strz_utf16_v1.py create mode 100644 compiled/construct/term_strz_utf16_v2.py create mode 100644 compiled/construct/term_strz_utf16_v3.py create mode 100644 compiled/construct/term_strz_utf16_v4.py create mode 100644 compiled/construct/valid_fail_repeat_anyof_int.py create mode 100644 compiled/construct/valid_fail_repeat_contents.py create mode 100644 compiled/construct/valid_fail_repeat_eq_int.py create mode 100644 compiled/construct/valid_fail_repeat_expr.py create mode 100644 compiled/construct/valid_fail_repeat_inst.py create mode 100644 compiled/construct/valid_fail_repeat_max_int.py create mode 100644 compiled/construct/valid_fail_repeat_min_int.py create mode 100644 compiled/cpp_stl_11/str_pad_term_utf16.cpp create mode 100644 compiled/cpp_stl_11/str_pad_term_utf16.h create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v1.cpp create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v1.h create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v2.cpp create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v2.h create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v3.cpp create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v3.h create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v4.cpp create mode 100644 compiled/cpp_stl_11/term_strz_utf16_v4.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_anyof_int.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_anyof_int.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_contents.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_contents.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_eq_int.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_eq_int.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_expr.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_expr.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_inst.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_inst.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_max_int.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_max_int.h create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_min_int.cpp create mode 100644 compiled/cpp_stl_11/valid_fail_repeat_min_int.h create mode 100644 compiled/cpp_stl_98/str_pad_term_utf16.cpp create mode 100644 compiled/cpp_stl_98/str_pad_term_utf16.h create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v1.cpp create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v1.h create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v2.cpp create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v2.h create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v3.cpp create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v3.h create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v4.cpp create mode 100644 compiled/cpp_stl_98/term_strz_utf16_v4.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_anyof_int.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_anyof_int.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_contents.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_contents.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_eq_int.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_eq_int.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_expr.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_expr.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_inst.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_inst.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_max_int.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_max_int.h create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_min_int.cpp create mode 100644 compiled/cpp_stl_98/valid_fail_repeat_min_int.h create mode 100644 compiled/csharp/StrPadTermUtf16.cs create mode 100644 compiled/csharp/TermStrzUtf16V1.cs create mode 100644 compiled/csharp/TermStrzUtf16V2.cs create mode 100644 compiled/csharp/TermStrzUtf16V3.cs create mode 100644 compiled/csharp/TermStrzUtf16V4.cs create mode 100644 compiled/csharp/ValidFailRepeatAnyofInt.cs create mode 100644 compiled/csharp/ValidFailRepeatContents.cs create mode 100644 compiled/csharp/ValidFailRepeatEqInt.cs create mode 100644 compiled/csharp/ValidFailRepeatExpr.cs create mode 100644 compiled/csharp/ValidFailRepeatInst.cs create mode 100644 compiled/csharp/ValidFailRepeatMaxInt.cs create mode 100644 compiled/csharp/ValidFailRepeatMinInt.cs create mode 100644 compiled/go/src/test_formats/str_pad_term_utf16.go create mode 100644 compiled/go/src/test_formats/term_strz_utf16_v1.go create mode 100644 compiled/go/src/test_formats/term_strz_utf16_v2.go create mode 100644 compiled/go/src/test_formats/term_strz_utf16_v3.go create mode 100644 compiled/go/src/test_formats/term_strz_utf16_v4.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_anyof_int.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_contents.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_eq_int.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_expr.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_inst.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_max_int.go create mode 100644 compiled/go/src/test_formats/valid_fail_repeat_min_int.go create mode 100644 compiled/graphviz/str_pad_term_utf16.dot create mode 100644 compiled/graphviz/term_strz_utf16_v1.dot create mode 100644 compiled/graphviz/term_strz_utf16_v2.dot create mode 100644 compiled/graphviz/term_strz_utf16_v3.dot create mode 100644 compiled/graphviz/term_strz_utf16_v4.dot create mode 100644 compiled/graphviz/valid_fail_repeat_anyof_int.dot create mode 100644 compiled/graphviz/valid_fail_repeat_contents.dot create mode 100644 compiled/graphviz/valid_fail_repeat_eq_int.dot create mode 100644 compiled/graphviz/valid_fail_repeat_expr.dot create mode 100644 compiled/graphviz/valid_fail_repeat_inst.dot create mode 100644 compiled/graphviz/valid_fail_repeat_max_int.dot create mode 100644 compiled/graphviz/valid_fail_repeat_min_int.dot create mode 100644 compiled/html/str_pad_term_utf16.html create mode 100644 compiled/html/term_strz_utf16_v1.html create mode 100644 compiled/html/term_strz_utf16_v2.html create mode 100644 compiled/html/term_strz_utf16_v3.html create mode 100644 compiled/html/term_strz_utf16_v4.html create mode 100644 compiled/html/valid_fail_repeat_anyof_int.html create mode 100644 compiled/html/valid_fail_repeat_contents.html create mode 100644 compiled/html/valid_fail_repeat_eq_int.html create mode 100644 compiled/html/valid_fail_repeat_expr.html create mode 100644 compiled/html/valid_fail_repeat_inst.html create mode 100644 compiled/html/valid_fail_repeat_max_int.html create mode 100644 compiled/html/valid_fail_repeat_min_int.html create mode 100644 compiled/java/src/io/kaitai/struct/testformats/StrPadTermUtf16.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V1.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V2.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V3.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V4.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatAnyofInt.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatContents.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatEqInt.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatExpr.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatInst.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMaxInt.java create mode 100644 compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMinInt.java create mode 100644 compiled/javascript/StrPadTermUtf16.js create mode 100644 compiled/javascript/TermStrzUtf16V1.js create mode 100644 compiled/javascript/TermStrzUtf16V2.js create mode 100644 compiled/javascript/TermStrzUtf16V3.js create mode 100644 compiled/javascript/TermStrzUtf16V4.js create mode 100644 compiled/javascript/ValidFailRepeatAnyofInt.js create mode 100644 compiled/javascript/ValidFailRepeatContents.js create mode 100644 compiled/javascript/ValidFailRepeatEqInt.js create mode 100644 compiled/javascript/ValidFailRepeatExpr.js create mode 100644 compiled/javascript/ValidFailRepeatInst.js create mode 100644 compiled/javascript/ValidFailRepeatMaxInt.js create mode 100644 compiled/javascript/ValidFailRepeatMinInt.js create mode 100644 compiled/lua/str_pad_term_utf16.lua create mode 100644 compiled/lua/term_strz_utf16_v1.lua create mode 100644 compiled/lua/term_strz_utf16_v2.lua create mode 100644 compiled/lua/term_strz_utf16_v3.lua create mode 100644 compiled/lua/term_strz_utf16_v4.lua create mode 100644 compiled/lua/valid_fail_repeat_anyof_int.lua create mode 100644 compiled/lua/valid_fail_repeat_contents.lua create mode 100644 compiled/lua/valid_fail_repeat_eq_int.lua create mode 100644 compiled/lua/valid_fail_repeat_expr.lua create mode 100644 compiled/lua/valid_fail_repeat_inst.lua create mode 100644 compiled/lua/valid_fail_repeat_max_int.lua create mode 100644 compiled/lua/valid_fail_repeat_min_int.lua create mode 100644 compiled/nim/str_pad_term_utf16.nim create mode 100644 compiled/nim/term_strz_utf16_v1.nim create mode 100644 compiled/nim/term_strz_utf16_v2.nim create mode 100644 compiled/nim/term_strz_utf16_v3.nim create mode 100644 compiled/nim/term_strz_utf16_v4.nim create mode 100644 compiled/nim/valid_fail_repeat_anyof_int.nim create mode 100644 compiled/nim/valid_fail_repeat_contents.nim create mode 100644 compiled/nim/valid_fail_repeat_eq_int.nim create mode 100644 compiled/nim/valid_fail_repeat_inst.nim create mode 100644 compiled/nim/valid_fail_repeat_max_int.nim create mode 100644 compiled/nim/valid_fail_repeat_min_int.nim create mode 100644 compiled/perl/StrPadTermUtf16.pm create mode 100644 compiled/perl/TermStrzUtf16V1.pm create mode 100644 compiled/perl/TermStrzUtf16V2.pm create mode 100644 compiled/perl/TermStrzUtf16V3.pm create mode 100644 compiled/perl/TermStrzUtf16V4.pm create mode 100644 compiled/perl/ValidFailRepeatAnyofInt.pm create mode 100644 compiled/perl/ValidFailRepeatContents.pm create mode 100644 compiled/perl/ValidFailRepeatEqInt.pm create mode 100644 compiled/perl/ValidFailRepeatInst.pm create mode 100644 compiled/perl/ValidFailRepeatMaxInt.pm create mode 100644 compiled/perl/ValidFailRepeatMinInt.pm create mode 100644 compiled/php/StrPadTermUtf16.php create mode 100644 compiled/php/TermStrzUtf16V1.php create mode 100644 compiled/php/TermStrzUtf16V2.php create mode 100644 compiled/php/TermStrzUtf16V3.php create mode 100644 compiled/php/TermStrzUtf16V4.php create mode 100644 compiled/php/ValidFailRepeatAnyofInt.php create mode 100644 compiled/php/ValidFailRepeatContents.php create mode 100644 compiled/php/ValidFailRepeatEqInt.php create mode 100644 compiled/php/ValidFailRepeatExpr.php create mode 100644 compiled/php/ValidFailRepeatInst.php create mode 100644 compiled/php/ValidFailRepeatMaxInt.php create mode 100644 compiled/php/ValidFailRepeatMinInt.php create mode 100644 compiled/python/str_pad_term_utf16.py create mode 100644 compiled/python/term_strz_utf16_v1.py create mode 100644 compiled/python/term_strz_utf16_v2.py create mode 100644 compiled/python/term_strz_utf16_v3.py create mode 100644 compiled/python/term_strz_utf16_v4.py create mode 100644 compiled/python/valid_fail_repeat_anyof_int.py create mode 100644 compiled/python/valid_fail_repeat_contents.py create mode 100644 compiled/python/valid_fail_repeat_eq_int.py create mode 100644 compiled/python/valid_fail_repeat_expr.py create mode 100644 compiled/python/valid_fail_repeat_inst.py create mode 100644 compiled/python/valid_fail_repeat_max_int.py create mode 100644 compiled/python/valid_fail_repeat_min_int.py create mode 100644 compiled/ruby/str_pad_term_utf16.rb create mode 100644 compiled/ruby/term_strz_utf16_v1.rb create mode 100644 compiled/ruby/term_strz_utf16_v2.rb create mode 100644 compiled/ruby/term_strz_utf16_v3.rb create mode 100644 compiled/ruby/term_strz_utf16_v4.rb create mode 100644 compiled/ruby/valid_fail_repeat_anyof_int.rb create mode 100644 compiled/ruby/valid_fail_repeat_contents.rb create mode 100644 compiled/ruby/valid_fail_repeat_eq_int.rb create mode 100644 compiled/ruby/valid_fail_repeat_expr.rb create mode 100644 compiled/ruby/valid_fail_repeat_inst.rb create mode 100644 compiled/ruby/valid_fail_repeat_max_int.rb create mode 100644 compiled/ruby/valid_fail_repeat_min_int.rb create mode 100644 compiled/rust/str_pad_term_utf16.rs create mode 100644 compiled/rust/term_strz_utf16_v1.rs create mode 100644 compiled/rust/term_strz_utf16_v2.rs create mode 100644 compiled/rust/term_strz_utf16_v3.rs create mode 100644 compiled/rust/term_strz_utf16_v4.rs create mode 100644 compiled/rust/valid_fail_repeat_anyof_int.rs create mode 100644 compiled/rust/valid_fail_repeat_contents.rs create mode 100644 compiled/rust/valid_fail_repeat_eq_int.rs create mode 100644 compiled/rust/valid_fail_repeat_inst.rs create mode 100644 compiled/rust/valid_fail_repeat_max_int.rs create mode 100644 compiled/rust/valid_fail_repeat_min_int.rs diff --git a/compiled/construct/bytes_pad_term.py b/compiled/construct/bytes_pad_term.py index d1bfb5896..463977130 100644 --- a/compiled/construct/bytes_pad_term.py +++ b/compiled/construct/bytes_pad_term.py @@ -3,9 +3,9 @@ bytes_pad_term = Struct( 'str_pad' / FixedSized(20, NullStripped(GreedyBytes, pad=b'\x40')), - 'str_term' / FixedSized(20, NullTerminated(GreedyBytes, term=b'\x40', include=False)), - 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyBytes, term=b'\x40', include=False), pad=b'\x2B')), - 'str_term_include' / FixedSized(20, NullTerminated(GreedyBytes, term=b'\x40', include=True)), + 'str_term' / FixedSized(20, NullTerminated(GreedyBytes, term=b"\x40", include=False)), + 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyBytes, term=b"\x40", include=False), pad=b'\x2B')), + 'str_term_include' / FixedSized(20, NullTerminated(GreedyBytes, term=b"\x40", include=True)), ) _schema = bytes_pad_term diff --git a/compiled/construct/cast_nested.py b/compiled/construct/cast_nested.py index d17d1132c..80e455a2c 100644 --- a/compiled/construct/cast_nested.py +++ b/compiled/construct/cast_nested.py @@ -6,7 +6,7 @@ ) cast_nested__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) cast_nested__opcode = Struct( diff --git a/compiled/construct/combine_bytes.py b/compiled/construct/combine_bytes.py index b23fc3137..7b16d8960 100644 --- a/compiled/construct/combine_bytes.py +++ b/compiled/construct/combine_bytes.py @@ -2,7 +2,7 @@ from construct.lib import * combine_bytes = Struct( - 'bytes_term' / NullTerminated(GreedyBytes, term=b'\x7C', include=False, consume=True), + 'bytes_term' / NullTerminated(GreedyBytes, term=b"\x7C", include=False, consume=True), 'bytes_limit' / FixedSized(4, GreedyBytes), 'bytes_eos' / GreedyBytes, 'bytes_calc' / Computed(lambda this: b"\x52\x6E\x44"), diff --git a/compiled/construct/combine_str.py b/compiled/construct/combine_str.py index ee34a76eb..d7fa7cc7b 100644 --- a/compiled/construct/combine_str.py +++ b/compiled/construct/combine_str.py @@ -2,7 +2,7 @@ from construct.lib import * combine_str = Struct( - 'str_term' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x7C', include=False, consume=True), + 'str_term' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x7C", include=False, consume=True), 'str_limit' / FixedSized(4, GreedyString(encoding='ASCII')), 'str_eos' / GreedyString(encoding='ASCII'), 'calc_bytes' / Computed(lambda this: b"\x62\x61\x7A"), diff --git a/compiled/construct/expr_array.py b/compiled/construct/expr_array.py index 76fe9e62a..01fab8b93 100644 --- a/compiled/construct/expr_array.py +++ b/compiled/construct/expr_array.py @@ -4,7 +4,7 @@ expr_array = Struct( 'aint' / Array(4, Int32ul), 'afloat' / Array(3, Float64l), - 'astr' / Array(3, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), + 'astr' / Array(3, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), 'afloat_first' / Computed(lambda this: this.afloat[0]), 'afloat_last' / Computed(lambda this: this.afloat[-1]), 'afloat_max' / Computed(lambda this: max(this.afloat)), diff --git a/compiled/construct/expr_io_pos.py b/compiled/construct/expr_io_pos.py index dd81e6e36..121b89bf6 100644 --- a/compiled/construct/expr_io_pos.py +++ b/compiled/construct/expr_io_pos.py @@ -2,7 +2,7 @@ from construct.lib import * expr_io_pos__all_plus_number = Struct( - 'my_str' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), + 'my_str' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), 'body' / FixedSized((stream_size(_io) - stream_tell(_io)) - 2, GreedyBytes), 'number' / Int16ul, ) diff --git a/compiled/construct/instance_io_user.py b/compiled/construct/instance_io_user.py index f3cc5b6e8..d44e73875 100644 --- a/compiled/construct/instance_io_user.py +++ b/compiled/construct/instance_io_user.py @@ -4,11 +4,11 @@ instance_io_user__entry = Struct( 'name_ofs' / Int32ul, 'value' / Int32ul, - 'name' / Pointer(this.name_ofs, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), + 'name' / Pointer(this.name_ofs, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), ) instance_io_user__strings_obj = Struct( - 'str' / GreedyRange(NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), + 'str' / GreedyRange(NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), ) instance_io_user = Struct( diff --git a/compiled/construct/nav_parent_vs_value_inst.py b/compiled/construct/nav_parent_vs_value_inst.py index 36723b083..47c2e2bed 100644 --- a/compiled/construct/nav_parent_vs_value_inst.py +++ b/compiled/construct/nav_parent_vs_value_inst.py @@ -6,7 +6,7 @@ ) nav_parent_vs_value_inst = Struct( - 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=True), + 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=True), 'child' / LazyBound(lambda: nav_parent_vs_value_inst__child_obj), ) diff --git a/compiled/construct/opaque_external_type_02_child.py b/compiled/construct/opaque_external_type_02_child.py index b6be1a7ee..69f6be9bf 100644 --- a/compiled/construct/opaque_external_type_02_child.py +++ b/compiled/construct/opaque_external_type_02_child.py @@ -2,12 +2,12 @@ from construct.lib import * opaque_external_type_02_child__opaque_external_type_02_child_child = Struct( - 's3' / If(this._root.some_method, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=True, consume=True)), + 's3' / If(this._root.some_method, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=True, consume=True)), ) opaque_external_type_02_child = Struct( - 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=True), - 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=False), + 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=True), + 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=False), 's3' / LazyBound(lambda: opaque_external_type_02_child__opaque_external_type_02_child_child), 'some_method' / Computed(lambda this: True), ) diff --git a/compiled/construct/position_abs.py b/compiled/construct/position_abs.py index 4779c0727..c35876ee1 100644 --- a/compiled/construct/position_abs.py +++ b/compiled/construct/position_abs.py @@ -2,7 +2,7 @@ from construct.lib import * position_abs__index_obj = Struct( - 'entry' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), + 'entry' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), ) position_abs = Struct( diff --git a/compiled/construct/repeat_n_strz.py b/compiled/construct/repeat_n_strz.py index fae5ea253..e2da171e1 100644 --- a/compiled/construct/repeat_n_strz.py +++ b/compiled/construct/repeat_n_strz.py @@ -3,7 +3,7 @@ repeat_n_strz = Struct( 'qty' / Int32ul, - 'lines' / Array(this.qty, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), + 'lines' / Array(this.qty, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), ) _schema = repeat_n_strz diff --git a/compiled/construct/repeat_n_strz_double.py b/compiled/construct/repeat_n_strz_double.py index 44e9165f8..01dcf2862 100644 --- a/compiled/construct/repeat_n_strz_double.py +++ b/compiled/construct/repeat_n_strz_double.py @@ -3,8 +3,8 @@ repeat_n_strz_double = Struct( 'qty' / Int32ul, - 'lines1' / Array(this.qty // 2, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), - 'lines2' / Array(this.qty // 2, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True)), + 'lines1' / Array(this.qty // 2, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), + 'lines2' / Array(this.qty // 2, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True)), ) _schema = repeat_n_strz_double diff --git a/compiled/construct/repeat_until_s4.py b/compiled/construct/repeat_until_s4.py index fd3832781..d88020352 100644 --- a/compiled/construct/repeat_until_s4.py +++ b/compiled/construct/repeat_until_s4.py @@ -3,7 +3,7 @@ repeat_until_s4 = Struct( 'entries' / RepeatUntil(lambda obj_, list_, this: obj_ == -1, Int32sl), - 'afterall' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'afterall' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) _schema = repeat_until_s4 diff --git a/compiled/construct/str_pad_term.py b/compiled/construct/str_pad_term.py index 2eea6da12..494f1e9c0 100644 --- a/compiled/construct/str_pad_term.py +++ b/compiled/construct/str_pad_term.py @@ -3,9 +3,9 @@ str_pad_term = Struct( 'str_pad' / FixedSized(20, NullStripped(GreedyString(encoding='UTF-8'), pad=b'\x40')), - 'str_term' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=False)), - 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=False), pad=b'\x2B')), - 'str_term_include' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=True)), + 'str_term' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=False)), + 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=False), pad=b'\x2B')), + 'str_term_include' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=True)), ) _schema = str_pad_term diff --git a/compiled/construct/str_pad_term_empty.py b/compiled/construct/str_pad_term_empty.py index 922e9a342..0def8ee7a 100644 --- a/compiled/construct/str_pad_term_empty.py +++ b/compiled/construct/str_pad_term_empty.py @@ -3,9 +3,9 @@ str_pad_term_empty = Struct( 'str_pad' / FixedSized(20, NullStripped(GreedyString(encoding='UTF-8'), pad=b'\x40')), - 'str_term' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=False)), - 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=False), pad=b'\x2B')), - 'str_term_include' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=True)), + 'str_term' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=False)), + 'str_term_and_pad' / FixedSized(20, NullStripped(NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=False), pad=b'\x2B')), + 'str_term_include' / FixedSized(20, NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=True)), ) _schema = str_pad_term_empty diff --git a/compiled/construct/str_pad_term_utf16.py b/compiled/construct/str_pad_term_utf16.py new file mode 100644 index 000000000..70c1983ae --- /dev/null +++ b/compiled/construct/str_pad_term_utf16.py @@ -0,0 +1,10 @@ +from construct import * +from construct.lib import * + +str_pad_term_utf16 = Struct( + 'str_term' / FixedSized(10, NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False)), + 'str_term_include' / FixedSized(10, NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=True)), + 'str_term_and_pad' / FixedSized(9, NullStripped(NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False), pad=b'\x2B')), +) + +_schema = str_pad_term_utf16 diff --git a/compiled/construct/switch_bytearray.py b/compiled/construct/switch_bytearray.py index 2e9eb77f6..bda016a9e 100644 --- a/compiled/construct/switch_bytearray.py +++ b/compiled/construct/switch_bytearray.py @@ -6,7 +6,7 @@ ) switch_bytearray__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_bytearray__opcode = Struct( diff --git a/compiled/construct/switch_cast.py b/compiled/construct/switch_cast.py index 1bedea103..5b146466c 100644 --- a/compiled/construct/switch_cast.py +++ b/compiled/construct/switch_cast.py @@ -11,7 +11,7 @@ ) switch_cast__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_cast = Struct( diff --git a/compiled/construct/switch_manual_enum.py b/compiled/construct/switch_manual_enum.py index 78e99e3c8..9ff43e1de 100644 --- a/compiled/construct/switch_manual_enum.py +++ b/compiled/construct/switch_manual_enum.py @@ -11,7 +11,7 @@ class switch_manual_enum__opcode__code_enum(enum.IntEnum): ) switch_manual_enum__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_enum__opcode = Struct( diff --git a/compiled/construct/switch_manual_enum_invalid.py b/compiled/construct/switch_manual_enum_invalid.py index f2e3c7a33..cf455cbe7 100644 --- a/compiled/construct/switch_manual_enum_invalid.py +++ b/compiled/construct/switch_manual_enum_invalid.py @@ -11,7 +11,7 @@ class switch_manual_enum_invalid__opcode__code_enum(enum.IntEnum): ) switch_manual_enum_invalid__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_enum_invalid__opcode = Struct( diff --git a/compiled/construct/switch_manual_enum_invalid_else.py b/compiled/construct/switch_manual_enum_invalid_else.py index 505d52355..09c8291ae 100644 --- a/compiled/construct/switch_manual_enum_invalid_else.py +++ b/compiled/construct/switch_manual_enum_invalid_else.py @@ -15,7 +15,7 @@ class switch_manual_enum_invalid_else__opcode__code_enum(enum.IntEnum): ) switch_manual_enum_invalid_else__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_enum_invalid_else__opcode = Struct( diff --git a/compiled/construct/switch_manual_int.py b/compiled/construct/switch_manual_int.py index f2aa09175..fee74b80f 100644 --- a/compiled/construct/switch_manual_int.py +++ b/compiled/construct/switch_manual_int.py @@ -6,7 +6,7 @@ ) switch_manual_int__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_int__opcode = Struct( diff --git a/compiled/construct/switch_manual_int_else.py b/compiled/construct/switch_manual_int_else.py index f5a5c8640..92c4c1247 100644 --- a/compiled/construct/switch_manual_int_else.py +++ b/compiled/construct/switch_manual_int_else.py @@ -10,7 +10,7 @@ ) switch_manual_int_else__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_int_else__opcode = Struct( diff --git a/compiled/construct/switch_manual_int_size.py b/compiled/construct/switch_manual_int_size.py index 5711bb5b3..ce8958500 100644 --- a/compiled/construct/switch_manual_int_size.py +++ b/compiled/construct/switch_manual_int_size.py @@ -6,8 +6,8 @@ ) switch_manual_int_size__chunk__chunk_meta = Struct( - 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), - 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), + 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), + 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), ) switch_manual_int_size__chunk = Struct( diff --git a/compiled/construct/switch_manual_int_size_else.py b/compiled/construct/switch_manual_int_size_else.py index 8c2f8f2bc..3e22c6a3e 100644 --- a/compiled/construct/switch_manual_int_size_else.py +++ b/compiled/construct/switch_manual_int_size_else.py @@ -6,8 +6,8 @@ ) switch_manual_int_size_else__chunk__chunk_meta = Struct( - 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), - 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), + 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), + 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), ) switch_manual_int_size_else__chunk__dummy = Struct( diff --git a/compiled/construct/switch_manual_int_size_eos.py b/compiled/construct/switch_manual_int_size_eos.py index 313809f2b..9e6c0b7e9 100644 --- a/compiled/construct/switch_manual_int_size_eos.py +++ b/compiled/construct/switch_manual_int_size_eos.py @@ -12,8 +12,8 @@ ) switch_manual_int_size_eos__chunk_body__chunk_meta = Struct( - 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), - 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x00', include=False, consume=True), + 'title' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), + 'author' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x00", include=False, consume=True), ) switch_manual_int_size_eos__chunk_body = Struct( diff --git a/compiled/construct/switch_manual_str.py b/compiled/construct/switch_manual_str.py index f713888e2..768f0acac 100644 --- a/compiled/construct/switch_manual_str.py +++ b/compiled/construct/switch_manual_str.py @@ -6,7 +6,7 @@ ) switch_manual_str__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_str__opcode = Struct( diff --git a/compiled/construct/switch_manual_str_else.py b/compiled/construct/switch_manual_str_else.py index 2b02ca27b..5f89de53c 100644 --- a/compiled/construct/switch_manual_str_else.py +++ b/compiled/construct/switch_manual_str_else.py @@ -10,7 +10,7 @@ ) switch_manual_str_else__opcode__strval = Struct( - 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True), + 'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b"\x00", include=False, consume=True), ) switch_manual_str_else__opcode = Struct( diff --git a/compiled/construct/term_bytes.py b/compiled/construct/term_bytes.py index 18d8f2b62..1a7a4310d 100644 --- a/compiled/construct/term_bytes.py +++ b/compiled/construct/term_bytes.py @@ -2,9 +2,9 @@ from construct.lib import * term_bytes = Struct( - 's1' / NullTerminated(GreedyBytes, term=b'\x7C', include=False, consume=True), - 's2' / NullTerminated(GreedyBytes, term=b'\x7C', include=False, consume=False), - 's3' / NullTerminated(GreedyBytes, term=b'\x40', include=True, consume=True), + 's1' / NullTerminated(GreedyBytes, term=b"\x7C", include=False, consume=True), + 's2' / NullTerminated(GreedyBytes, term=b"\x7C", include=False, consume=False), + 's3' / NullTerminated(GreedyBytes, term=b"\x40", include=True, consume=True), ) _schema = term_bytes diff --git a/compiled/construct/term_strz.py b/compiled/construct/term_strz.py index 95d90edd7..1082eb748 100644 --- a/compiled/construct/term_strz.py +++ b/compiled/construct/term_strz.py @@ -2,9 +2,9 @@ from construct.lib import * term_strz = Struct( - 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=True), - 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=False), - 's3' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x40', include=True, consume=True), + 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=True), + 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=False), + 's3' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x40", include=True, consume=True), ) _schema = term_strz diff --git a/compiled/construct/term_strz_utf16_v1.py b/compiled/construct/term_strz_utf16_v1.py new file mode 100644 index 000000000..d058b66c8 --- /dev/null +++ b/compiled/construct/term_strz_utf16_v1.py @@ -0,0 +1,11 @@ +from construct import * +from construct.lib import * + +term_strz_utf16_v1 = Struct( + 's1' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=True), + 's2' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=False), + 'term' / Int16ul, + 's3' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=True, consume=True), +) + +_schema = term_strz_utf16_v1 diff --git a/compiled/construct/term_strz_utf16_v2.py b/compiled/construct/term_strz_utf16_v2.py new file mode 100644 index 000000000..5b41a05b4 --- /dev/null +++ b/compiled/construct/term_strz_utf16_v2.py @@ -0,0 +1,10 @@ +from construct import * +from construct.lib import * + +term_strz_utf16_v2 = Struct( + 's1' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=True), + 's2' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=True, consume=True), + 's3' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=False), +) + +_schema = term_strz_utf16_v2 diff --git a/compiled/construct/term_strz_utf16_v3.py b/compiled/construct/term_strz_utf16_v3.py new file mode 100644 index 000000000..d1e847e1a --- /dev/null +++ b/compiled/construct/term_strz_utf16_v3.py @@ -0,0 +1,11 @@ +from construct import * +from construct.lib import * + +term_strz_utf16_v3 = Struct( + 's1' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=False), + 'term' / Int16ul, + 's2' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=False), + 's3' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=True), +) + +_schema = term_strz_utf16_v3 diff --git a/compiled/construct/term_strz_utf16_v4.py b/compiled/construct/term_strz_utf16_v4.py new file mode 100644 index 000000000..a2d52b190 --- /dev/null +++ b/compiled/construct/term_strz_utf16_v4.py @@ -0,0 +1,24 @@ +from construct import * +from construct.lib import * + +term_strz_utf16_v4__s1_type = Struct( + 'value' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=True), +) + +term_strz_utf16_v4__s2_type = Struct( + 'value' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=False, consume=False), +) + +term_strz_utf16_v4__s3_type = Struct( + 'value' / NullTerminated(GreedyString(encoding='UTF-16LE'), term=b"\x00\x00", include=True, consume=True), +) + +term_strz_utf16_v4 = Struct( + 's1' / FixedSized(6, LazyBound(lambda: term_strz_utf16_v4__s1_type)), + 'skip_term1' / FixedSized(2, GreedyBytes), + 's2' / FixedSized(6, LazyBound(lambda: term_strz_utf16_v4__s2_type)), + 'skip_term2' / FixedSized(2, GreedyBytes), + 's3' / FixedSized(6, LazyBound(lambda: term_strz_utf16_v4__s3_type)), +) + +_schema = term_strz_utf16_v4 diff --git a/compiled/construct/term_u1_val.py b/compiled/construct/term_u1_val.py index c7d759964..1427feb1b 100644 --- a/compiled/construct/term_u1_val.py +++ b/compiled/construct/term_u1_val.py @@ -2,8 +2,8 @@ from construct.lib import * term_u1_val = Struct( - 'foo' / NullTerminated(GreedyBytes, term=b'\xE3', include=False, consume=False), - 'bar' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\xAB', include=True, consume=True), + 'foo' / NullTerminated(GreedyBytes, term=b"\xE3", include=False, consume=False), + 'bar' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\xAB", include=True, consume=True), ) _schema = term_u1_val diff --git a/compiled/construct/to_string_custom.py b/compiled/construct/to_string_custom.py index 5ca3bae80..cb5649674 100644 --- a/compiled/construct/to_string_custom.py +++ b/compiled/construct/to_string_custom.py @@ -2,8 +2,8 @@ from construct.lib import * to_string_custom = Struct( - 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=True), - 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b'\x7C', include=False, consume=True), + 's1' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=True), + 's2' / NullTerminated(GreedyString(encoding='UTF-8'), term=b"\x7C", include=False, consume=True), ) _schema = to_string_custom diff --git a/compiled/construct/valid_fail_repeat_anyof_int.py b/compiled/construct/valid_fail_repeat_anyof_int.py new file mode 100644 index 000000000..3777e180e --- /dev/null +++ b/compiled/construct/valid_fail_repeat_anyof_int.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_anyof_int = Struct( + 'foo' / GreedyRange(Int8ub), +) + +_schema = valid_fail_repeat_anyof_int diff --git a/compiled/construct/valid_fail_repeat_contents.py b/compiled/construct/valid_fail_repeat_contents.py new file mode 100644 index 000000000..4a8c69cf0 --- /dev/null +++ b/compiled/construct/valid_fail_repeat_contents.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_contents = Struct( + 'foo' / GreedyRange(FixedSized(4, GreedyBytes)), +) + +_schema = valid_fail_repeat_contents diff --git a/compiled/construct/valid_fail_repeat_eq_int.py b/compiled/construct/valid_fail_repeat_eq_int.py new file mode 100644 index 000000000..90fdbbd08 --- /dev/null +++ b/compiled/construct/valid_fail_repeat_eq_int.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_eq_int = Struct( + 'foo' / GreedyRange(Int32ub), +) + +_schema = valid_fail_repeat_eq_int diff --git a/compiled/construct/valid_fail_repeat_expr.py b/compiled/construct/valid_fail_repeat_expr.py new file mode 100644 index 000000000..177ea2362 --- /dev/null +++ b/compiled/construct/valid_fail_repeat_expr.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_expr = Struct( + 'foo' / GreedyRange(FixedSized(4, GreedyBytes)), +) + +_schema = valid_fail_repeat_expr diff --git a/compiled/construct/valid_fail_repeat_inst.py b/compiled/construct/valid_fail_repeat_inst.py new file mode 100644 index 000000000..5b776f43b --- /dev/null +++ b/compiled/construct/valid_fail_repeat_inst.py @@ -0,0 +1,9 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_inst = Struct( + 'a' / If(len(this.inst) == 0, FixedSized(0, GreedyBytes)), + 'inst' / Pointer(0, GreedyRange(Int32ub)), +) + +_schema = valid_fail_repeat_inst diff --git a/compiled/construct/valid_fail_repeat_max_int.py b/compiled/construct/valid_fail_repeat_max_int.py new file mode 100644 index 000000000..2c6f28e8f --- /dev/null +++ b/compiled/construct/valid_fail_repeat_max_int.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_max_int = Struct( + 'foo' / GreedyRange(Int8ub), +) + +_schema = valid_fail_repeat_max_int diff --git a/compiled/construct/valid_fail_repeat_min_int.py b/compiled/construct/valid_fail_repeat_min_int.py new file mode 100644 index 000000000..223ae1d29 --- /dev/null +++ b/compiled/construct/valid_fail_repeat_min_int.py @@ -0,0 +1,8 @@ +from construct import * +from construct.lib import * + +valid_fail_repeat_min_int = Struct( + 'foo' / GreedyRange(Int8sb), +) + +_schema = valid_fail_repeat_min_int diff --git a/compiled/cpp_stl_11/fixed_contents.cpp b/compiled/cpp_stl_11/fixed_contents.cpp index fd568af39..6f7da1e55 100644 --- a/compiled/cpp_stl_11/fixed_contents.cpp +++ b/compiled/cpp_stl_11/fixed_contents.cpp @@ -11,12 +11,12 @@ fixed_contents_t::fixed_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__p void fixed_contents_t::_read() { m_normal = m__io->read_bytes(6); - if (!(normal() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), normal(), _io(), std::string("/seq/0")); + if (!(m_normal == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_normal, m__io, std::string("/seq/0")); } m_high_bit_8 = m__io->read_bytes(2); - if (!(high_bit_8() == std::string("\xFF\xFF", 2))) { - throw kaitai::validation_not_equal_error(std::string("\xFF\xFF", 2), high_bit_8(), _io(), std::string("/seq/1")); + if (!(m_high_bit_8 == std::string("\xFF\xFF", 2))) { + throw kaitai::validation_not_equal_error(std::string("\xFF\xFF", 2), m_high_bit_8, m__io, std::string("/seq/1")); } } diff --git a/compiled/cpp_stl_11/fixed_struct.cpp b/compiled/cpp_stl_11/fixed_struct.cpp index c5de4d9ce..8d5577321 100644 --- a/compiled/cpp_stl_11/fixed_struct.cpp +++ b/compiled/cpp_stl_11/fixed_struct.cpp @@ -31,49 +31,49 @@ fixed_struct_t::header_t::header_t(kaitai::kstream* p__io, fixed_struct_t* p__pa void fixed_struct_t::header_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/types/header/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/types/header/seq/0")); } m_uint8 = m__io->read_u1(); m_sint8 = m__io->read_s1(); m_magic_uint = m__io->read_bytes(10); - if (!(magic_uint() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), magic_uint(), _io(), std::string("/types/header/seq/3")); + if (!(m_magic_uint == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), m_magic_uint, m__io, std::string("/types/header/seq/3")); } m_uint16 = m__io->read_u2le(); m_uint32 = m__io->read_u4le(); m_uint64 = m__io->read_u8le(); m_magic_sint = m__io->read_bytes(10); - if (!(magic_sint() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), magic_sint(), _io(), std::string("/types/header/seq/7")); + if (!(m_magic_sint == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), m_magic_sint, m__io, std::string("/types/header/seq/7")); } m_sint16 = m__io->read_s2le(); m_sint32 = m__io->read_s4le(); m_sint64 = m__io->read_s8le(); m_magic_uint_le = m__io->read_bytes(9); - if (!(magic_uint_le() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), magic_uint_le(), _io(), std::string("/types/header/seq/11")); + if (!(m_magic_uint_le == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), m_magic_uint_le, m__io, std::string("/types/header/seq/11")); } m_uint16le = m__io->read_u2le(); m_uint32le = m__io->read_u4le(); m_uint64le = m__io->read_u8le(); m_magic_sint_le = m__io->read_bytes(9); - if (!(magic_sint_le() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), magic_sint_le(), _io(), std::string("/types/header/seq/15")); + if (!(m_magic_sint_le == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), m_magic_sint_le, m__io, std::string("/types/header/seq/15")); } m_sint16le = m__io->read_s2le(); m_sint32le = m__io->read_s4le(); m_sint64le = m__io->read_s8le(); m_magic_uint_be = m__io->read_bytes(9); - if (!(magic_uint_be() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), magic_uint_be(), _io(), std::string("/types/header/seq/19")); + if (!(m_magic_uint_be == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), m_magic_uint_be, m__io, std::string("/types/header/seq/19")); } m_uint16be = m__io->read_u2be(); m_uint32be = m__io->read_u4be(); m_uint64be = m__io->read_u8be(); m_magic_sint_be = m__io->read_bytes(9); - if (!(magic_sint_be() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), magic_sint_be(), _io(), std::string("/types/header/seq/23")); + if (!(m_magic_sint_be == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), m_magic_sint_be, m__io, std::string("/types/header/seq/23")); } m_sint16be = m__io->read_s2be(); m_sint32be = m__io->read_s4be(); diff --git a/compiled/cpp_stl_11/integers.cpp b/compiled/cpp_stl_11/integers.cpp index 541825f6a..6add08077 100644 --- a/compiled/cpp_stl_11/integers.cpp +++ b/compiled/cpp_stl_11/integers.cpp @@ -11,49 +11,49 @@ integers_t::integers_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, integ void integers_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); m_sint8 = m__io->read_s1(); m_magic_uint = m__io->read_bytes(10); - if (!(magic_uint() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); m_uint32 = m__io->read_u4le(); m_uint64 = m__io->read_u8le(); m_magic_sint = m__io->read_bytes(10); - if (!(magic_sint() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); m_sint32 = m__io->read_s4le(); m_sint64 = m__io->read_s8le(); m_magic_uint_le = m__io->read_bytes(9); - if (!(magic_uint_le() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), magic_uint_le(), _io(), std::string("/seq/11")); + if (!(m_magic_uint_le == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), m_magic_uint_le, m__io, std::string("/seq/11")); } m_uint16le = m__io->read_u2le(); m_uint32le = m__io->read_u4le(); m_uint64le = m__io->read_u8le(); m_magic_sint_le = m__io->read_bytes(9); - if (!(magic_sint_le() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), magic_sint_le(), _io(), std::string("/seq/15")); + if (!(m_magic_sint_le == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), m_magic_sint_le, m__io, std::string("/seq/15")); } m_sint16le = m__io->read_s2le(); m_sint32le = m__io->read_s4le(); m_sint64le = m__io->read_s8le(); m_magic_uint_be = m__io->read_bytes(9); - if (!(magic_uint_be() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), magic_uint_be(), _io(), std::string("/seq/19")); + if (!(m_magic_uint_be == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), m_magic_uint_be, m__io, std::string("/seq/19")); } m_uint16be = m__io->read_u2be(); m_uint32be = m__io->read_u4be(); m_uint64be = m__io->read_u8be(); m_magic_sint_be = m__io->read_bytes(9); - if (!(magic_sint_be() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), magic_sint_be(), _io(), std::string("/seq/23")); + if (!(m_magic_sint_be == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), m_magic_sint_be, m__io, std::string("/seq/23")); } m_sint16be = m__io->read_s2be(); m_sint32be = m__io->read_s4be(); diff --git a/compiled/cpp_stl_11/str_pad_term_utf16.cpp b/compiled/cpp_stl_11/str_pad_term_utf16.cpp new file mode 100644 index 000000000..3f4480be7 --- /dev/null +++ b/compiled/cpp_stl_11/str_pad_term_utf16.cpp @@ -0,0 +1,22 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "str_pad_term_utf16.h" + +str_pad_term_utf16_t::str_pad_term_utf16_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, str_pad_term_utf16_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + _read(); +} + +void str_pad_term_utf16_t::_read() { + m_str_term = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(m__io->read_bytes(10), std::string("\x00\x00", 2), false), "UTF-16LE"); + m_str_term_include = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(m__io->read_bytes(10), std::string("\x00\x00", 2), true), "UTF-16LE"); + m_str_term_and_pad = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(kaitai::kstream::bytes_strip_right(m__io->read_bytes(9), 43), std::string("\x00\x00", 2), false), "UTF-16LE"); +} + +str_pad_term_utf16_t::~str_pad_term_utf16_t() { + _clean_up(); +} + +void str_pad_term_utf16_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/str_pad_term_utf16.h b/compiled/cpp_stl_11/str_pad_term_utf16.h new file mode 100644 index 000000000..a6866aef0 --- /dev/null +++ b/compiled/cpp_stl_11/str_pad_term_utf16.h @@ -0,0 +1,41 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class str_pad_term_utf16_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class str_pad_term_utf16_t : public kaitai::kstruct { + +public: + + str_pad_term_utf16_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, str_pad_term_utf16_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~str_pad_term_utf16_t(); + +private: + std::string m_str_term; + std::string m_str_term_include; + std::string m_str_term_and_pad; + str_pad_term_utf16_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string str_term() const { return m_str_term; } + std::string str_term_include() const { return m_str_term_include; } + std::string str_term_and_pad() const { return m_str_term_and_pad; } + str_pad_term_utf16_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/term_strz_utf16_v1.cpp b/compiled/cpp_stl_11/term_strz_utf16_v1.cpp new file mode 100644 index 000000000..bc3642018 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v1.cpp @@ -0,0 +1,23 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v1.h" + +term_strz_utf16_v1_t::term_strz_utf16_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v1_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + _read(); +} + +void term_strz_utf16_v1_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_term = m__io->read_u2le(); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, true), "UTF-16LE"); +} + +term_strz_utf16_v1_t::~term_strz_utf16_v1_t() { + _clean_up(); +} + +void term_strz_utf16_v1_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/term_strz_utf16_v1.h b/compiled/cpp_stl_11/term_strz_utf16_v1.h new file mode 100644 index 000000000..625533a92 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v1.h @@ -0,0 +1,43 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v1_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v1_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, term_strz_utf16_v1_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v1_t(); + +private: + std::string m_s1; + std::string m_s2; + uint16_t m_term; + std::string m_s3; + term_strz_utf16_v1_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + std::string s2() const { return m_s2; } + uint16_t term() const { return m_term; } + std::string s3() const { return m_s3; } + term_strz_utf16_v1_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/term_strz_utf16_v2.cpp b/compiled/cpp_stl_11/term_strz_utf16_v2.cpp new file mode 100644 index 000000000..ca1f0adf8 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v2.cpp @@ -0,0 +1,22 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v2.h" + +term_strz_utf16_v2_t::term_strz_utf16_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v2_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + _read(); +} + +void term_strz_utf16_v2_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, true), "UTF-16LE"); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); +} + +term_strz_utf16_v2_t::~term_strz_utf16_v2_t() { + _clean_up(); +} + +void term_strz_utf16_v2_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/term_strz_utf16_v2.h b/compiled/cpp_stl_11/term_strz_utf16_v2.h new file mode 100644 index 000000000..25f0a0da3 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v2.h @@ -0,0 +1,41 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v2_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v2_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, term_strz_utf16_v2_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v2_t(); + +private: + std::string m_s1; + std::string m_s2; + std::string m_s3; + term_strz_utf16_v2_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + std::string s2() const { return m_s2; } + std::string s3() const { return m_s3; } + term_strz_utf16_v2_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/term_strz_utf16_v3.cpp b/compiled/cpp_stl_11/term_strz_utf16_v3.cpp new file mode 100644 index 000000000..bf79363a7 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v3.cpp @@ -0,0 +1,23 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v3.h" + +term_strz_utf16_v3_t::term_strz_utf16_v3_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v3_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + _read(); +} + +void term_strz_utf16_v3_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_term = m__io->read_u2le(); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); +} + +term_strz_utf16_v3_t::~term_strz_utf16_v3_t() { + _clean_up(); +} + +void term_strz_utf16_v3_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/term_strz_utf16_v3.h b/compiled/cpp_stl_11/term_strz_utf16_v3.h new file mode 100644 index 000000000..22c0f9315 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v3.h @@ -0,0 +1,43 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v3_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v3_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v3_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, term_strz_utf16_v3_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v3_t(); + +private: + std::string m_s1; + uint16_t m_term; + std::string m_s2; + std::string m_s3; + term_strz_utf16_v3_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + uint16_t term() const { return m_term; } + std::string s2() const { return m_s2; } + std::string s3() const { return m_s3; } + term_strz_utf16_v3_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/term_strz_utf16_v4.cpp b/compiled/cpp_stl_11/term_strz_utf16_v4.cpp new file mode 100644 index 000000000..b05c474a9 --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v4.cpp @@ -0,0 +1,87 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v4.h" + +term_strz_utf16_v4_t::term_strz_utf16_v4_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_s1 = nullptr; + m__io__raw_s1 = nullptr; + m_s2 = nullptr; + m__io__raw_s2 = nullptr; + m_s3 = nullptr; + m__io__raw_s3 = nullptr; + _read(); +} + +void term_strz_utf16_v4_t::_read() { + m__raw_s1 = m__io->read_bytes(6); + m__io__raw_s1 = std::unique_ptr(new kaitai::kstream(m__raw_s1)); + m_s1 = std::unique_ptr(new s1_type_t(m__io__raw_s1.get(), this, m__root)); + m_skip_term1 = m__io->read_bytes(2); + m__raw_s2 = m__io->read_bytes(6); + m__io__raw_s2 = std::unique_ptr(new kaitai::kstream(m__raw_s2)); + m_s2 = std::unique_ptr(new s2_type_t(m__io__raw_s2.get(), this, m__root)); + m_skip_term2 = m__io->read_bytes(2); + m__raw_s3 = m__io->read_bytes(6); + m__io__raw_s3 = std::unique_ptr(new kaitai::kstream(m__raw_s3)); + m_s3 = std::unique_ptr(new s3_type_t(m__io__raw_s3.get(), this, m__root)); +} + +term_strz_utf16_v4_t::~term_strz_utf16_v4_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::_clean_up() { +} + +term_strz_utf16_v4_t::s1_type_t::s1_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + _read(); +} + +void term_strz_utf16_v4_t::s1_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s1_type_t::~s1_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s1_type_t::_clean_up() { +} + +term_strz_utf16_v4_t::s2_type_t::s2_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + _read(); +} + +void term_strz_utf16_v4_t::s2_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s2_type_t::~s2_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s2_type_t::_clean_up() { +} + +term_strz_utf16_v4_t::s3_type_t::s3_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + _read(); +} + +void term_strz_utf16_v4_t::s3_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s3_type_t::~s3_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s3_type_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/term_strz_utf16_v4.h b/compiled/cpp_stl_11/term_strz_utf16_v4.h new file mode 100644 index 000000000..1ba00bf3c --- /dev/null +++ b/compiled/cpp_stl_11/term_strz_utf16_v4.h @@ -0,0 +1,132 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v4_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v4_t : public kaitai::kstruct { + +public: + class s1_type_t; + class s2_type_t; + class s3_type_t; + + term_strz_utf16_v4_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, term_strz_utf16_v4_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v4_t(); + + class s1_type_t : public kaitai::kstruct { + + public: + + s1_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = nullptr, term_strz_utf16_v4_t* p__root = nullptr); + + private: + void _read(); + void _clean_up(); + + public: + ~s1_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + + class s2_type_t : public kaitai::kstruct { + + public: + + s2_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = nullptr, term_strz_utf16_v4_t* p__root = nullptr); + + private: + void _read(); + void _clean_up(); + + public: + ~s2_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + + class s3_type_t : public kaitai::kstruct { + + public: + + s3_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = nullptr, term_strz_utf16_v4_t* p__root = nullptr); + + private: + void _read(); + void _clean_up(); + + public: + ~s3_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + +private: + std::unique_ptr m_s1; + std::string m_skip_term1; + std::unique_ptr m_s2; + std::string m_skip_term2; + std::unique_ptr m_s3; + term_strz_utf16_v4_t* m__root; + kaitai::kstruct* m__parent; + std::string m__raw_s1; + std::unique_ptr m__io__raw_s1; + std::string m__raw_s2; + std::unique_ptr m__io__raw_s2; + std::string m__raw_s3; + std::unique_ptr m__io__raw_s3; + +public: + s1_type_t* s1() const { return m_s1.get(); } + std::string skip_term1() const { return m_skip_term1; } + s2_type_t* s2() const { return m_s2.get(); } + std::string skip_term2() const { return m_skip_term2; } + s3_type_t* s3() const { return m_s3.get(); } + term_strz_utf16_v4_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } + std::string _raw_s1() const { return m__raw_s1; } + kaitai::kstream* _io__raw_s1() const { return m__io__raw_s1.get(); } + std::string _raw_s2() const { return m__raw_s2; } + kaitai::kstream* _io__raw_s2() const { return m__io__raw_s2.get(); } + std::string _raw_s3() const { return m__raw_s3; } + kaitai::kstream* _io__raw_s3() const { return m__io__raw_s3.get(); } +}; diff --git a/compiled/cpp_stl_11/valid_eq_str_encodings.cpp b/compiled/cpp_stl_11/valid_eq_str_encodings.cpp index 40b70f3cb..bfbfe2dd9 100644 --- a/compiled/cpp_stl_11/valid_eq_str_encodings.cpp +++ b/compiled/cpp_stl_11/valid_eq_str_encodings.cpp @@ -12,23 +12,23 @@ valid_eq_str_encodings_t::valid_eq_str_encodings_t(kaitai::kstream* p__io, kaita void valid_eq_str_encodings_t::_read() { m_len_of_1 = m__io->read_u2le(); m_str1 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_1()), "ASCII"); - if (!(str1() == (std::string("Some ASCII")))) { - throw kaitai::validation_not_equal_error(std::string("Some ASCII"), str1(), _io(), std::string("/seq/1")); + if (!(m_str1 == (std::string("Some ASCII")))) { + throw kaitai::validation_not_equal_error(std::string("Some ASCII"), m_str1, m__io, std::string("/seq/1")); } m_len_of_2 = m__io->read_u2le(); m_str2 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_2()), "UTF-8"); - if (!(str2() == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { - throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), str2(), _io(), std::string("/seq/3")); + if (!(m_str2 == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { + throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), m_str2, m__io, std::string("/seq/3")); } m_len_of_3 = m__io->read_u2le(); m_str3 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_3()), "SJIS"); - if (!(str3() == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { - throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), str3(), _io(), std::string("/seq/5")); + if (!(m_str3 == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { + throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), m_str3, m__io, std::string("/seq/5")); } m_len_of_4 = m__io->read_u2le(); m_str4 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_4()), "IBM437"); - if (!(str4() == (std::string("\u2591\u2592\u2593")))) { - throw kaitai::validation_not_equal_error(std::string("\u2591\u2592\u2593"), str4(), _io(), std::string("/seq/7")); + if (!(m_str4 == (std::string("\u2591\u2592\u2593")))) { + throw kaitai::validation_not_equal_error(std::string("\u2591\u2592\u2593"), m_str4, m__io, std::string("/seq/7")); } } diff --git a/compiled/cpp_stl_11/valid_fail_anyof_int.cpp b/compiled/cpp_stl_11/valid_fail_anyof_int.cpp index e4d6b9f47..965205e29 100644 --- a/compiled/cpp_stl_11/valid_fail_anyof_int.cpp +++ b/compiled/cpp_stl_11/valid_fail_anyof_int.cpp @@ -11,8 +11,8 @@ valid_fail_anyof_int_t::valid_fail_anyof_int_t(kaitai::kstream* p__io, kaitai::k void valid_fail_anyof_int_t::_read() { m_foo = m__io->read_u1(); - if (!( ((foo() == 5) || (foo() == 6) || (foo() == 7) || (foo() == 8) || (foo() == 10) || (foo() == 11) || (foo() == 12) || (foo() == 47)) )) { - throw kaitai::validation_not_any_of_error(foo(), _io(), std::string("/seq/0")); + if (!( ((m_foo == 5) || (m_foo == 6) || (m_foo == 7) || (m_foo == 8) || (m_foo == 10) || (m_foo == 11) || (m_foo == 12) || (m_foo == 47)) )) { + throw kaitai::validation_not_any_of_error(m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_contents.cpp b/compiled/cpp_stl_11/valid_fail_contents.cpp index 0bd2d3db5..6387aae22 100644 --- a/compiled/cpp_stl_11/valid_fail_contents.cpp +++ b/compiled/cpp_stl_11/valid_fail_contents.cpp @@ -11,8 +11,8 @@ valid_fail_contents_t::valid_fail_contents_t(kaitai::kstream* p__io, kaitai::kst void valid_fail_contents_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() == std::string("\x51\x41", 2))) { - throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == std::string("\x51\x41", 2))) { + throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_eq_bytes.cpp b/compiled/cpp_stl_11/valid_fail_eq_bytes.cpp index 0eff26452..bbb1584cb 100644 --- a/compiled/cpp_stl_11/valid_fail_eq_bytes.cpp +++ b/compiled/cpp_stl_11/valid_fail_eq_bytes.cpp @@ -11,8 +11,8 @@ valid_fail_eq_bytes_t::valid_fail_eq_bytes_t(kaitai::kstream* p__io, kaitai::kst void valid_fail_eq_bytes_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() == std::string("\x51\x41", 2))) { - throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == std::string("\x51\x41", 2))) { + throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_eq_int.cpp b/compiled/cpp_stl_11/valid_fail_eq_int.cpp index dd75dbc4c..e4d73a5dc 100644 --- a/compiled/cpp_stl_11/valid_fail_eq_int.cpp +++ b/compiled/cpp_stl_11/valid_fail_eq_int.cpp @@ -11,8 +11,8 @@ valid_fail_eq_int_t::valid_fail_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct void valid_fail_eq_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() == 123)) { - throw kaitai::validation_not_equal_error(123, foo(), _io(), std::string("/seq/0")); + if (!(m_foo == 123)) { + throw kaitai::validation_not_equal_error(123, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_eq_str.cpp b/compiled/cpp_stl_11/valid_fail_eq_str.cpp index 3839aa5e9..7c13127ec 100644 --- a/compiled/cpp_stl_11/valid_fail_eq_str.cpp +++ b/compiled/cpp_stl_11/valid_fail_eq_str.cpp @@ -11,8 +11,8 @@ valid_fail_eq_str_t::valid_fail_eq_str_t(kaitai::kstream* p__io, kaitai::kstruct void valid_fail_eq_str_t::_read() { m_foo = kaitai::kstream::bytes_to_str(m__io->read_bytes(4), "ASCII"); - if (!(foo() == (std::string("BACK")))) { - throw kaitai::validation_not_equal_error(std::string("BACK"), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == (std::string("BACK")))) { + throw kaitai::validation_not_equal_error(std::string("BACK"), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_expr.cpp b/compiled/cpp_stl_11/valid_fail_expr.cpp index 474d5e8c8..302cb56e2 100644 --- a/compiled/cpp_stl_11/valid_fail_expr.cpp +++ b/compiled/cpp_stl_11/valid_fail_expr.cpp @@ -12,16 +12,16 @@ valid_fail_expr_t::valid_fail_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p_ void valid_fail_expr_t::_read() { m_foo = m__io->read_u1(); { - uint8_t _ = foo(); + uint8_t _ = m_foo; if (!(_ == 1)) { - throw kaitai::validation_expr_error(foo(), _io(), std::string("/seq/0")); + throw kaitai::validation_expr_error(m_foo, m__io, std::string("/seq/0")); } } m_bar = m__io->read_s2le(); { - int16_t _ = bar(); + int16_t _ = m_bar; if (!( ((_ < -190) || (_ > -190)) )) { - throw kaitai::validation_expr_error(bar(), _io(), std::string("/seq/1")); + throw kaitai::validation_expr_error(m_bar, m__io, std::string("/seq/1")); } } } diff --git a/compiled/cpp_stl_11/valid_fail_inst.cpp b/compiled/cpp_stl_11/valid_fail_inst.cpp index 7f3fa7bd3..31fbcb48d 100644 --- a/compiled/cpp_stl_11/valid_fail_inst.cpp +++ b/compiled/cpp_stl_11/valid_fail_inst.cpp @@ -35,10 +35,10 @@ uint8_t valid_fail_inst_t::inst() { std::streampos _pos = m__io->pos(); m__io->seek(5); m_inst = m__io->read_u1(); + if (!(m_inst == 80)) { + throw kaitai::validation_not_equal_error(80, m_inst, m__io, std::string("/instances/inst")); + } m__io->seek(_pos); f_inst = true; - if (!(inst() == 80)) { - throw kaitai::validation_not_equal_error(80, inst(), _io(), std::string("/instances/inst")); - } return m_inst; } diff --git a/compiled/cpp_stl_11/valid_fail_max_int.cpp b/compiled/cpp_stl_11/valid_fail_max_int.cpp index 153e8a156..5fca64e1a 100644 --- a/compiled/cpp_stl_11/valid_fail_max_int.cpp +++ b/compiled/cpp_stl_11/valid_fail_max_int.cpp @@ -11,8 +11,8 @@ valid_fail_max_int_t::valid_fail_max_int_t(kaitai::kstream* p__io, kaitai::kstru void valid_fail_max_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() <= 12)) { - throw kaitai::validation_greater_than_error(12, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 12)) { + throw kaitai::validation_greater_than_error(12, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_min_int.cpp b/compiled/cpp_stl_11/valid_fail_min_int.cpp index 55547b29b..8e4acb96c 100644 --- a/compiled/cpp_stl_11/valid_fail_min_int.cpp +++ b/compiled/cpp_stl_11/valid_fail_min_int.cpp @@ -11,8 +11,8 @@ valid_fail_min_int_t::valid_fail_min_int_t(kaitai::kstream* p__io, kaitai::kstru void valid_fail_min_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() >= 123)) { - throw kaitai::validation_less_than_error(123, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 123)) { + throw kaitai::validation_less_than_error(123, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_range_bytes.cpp b/compiled/cpp_stl_11/valid_fail_range_bytes.cpp index 6b34cb6c1..79cd0781a 100644 --- a/compiled/cpp_stl_11/valid_fail_range_bytes.cpp +++ b/compiled/cpp_stl_11/valid_fail_range_bytes.cpp @@ -11,11 +11,11 @@ valid_fail_range_bytes_t::valid_fail_range_bytes_t(kaitai::kstream* p__io, kaita void valid_fail_range_bytes_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() >= std::string("\x50", 1))) { - throw kaitai::validation_less_than_error(std::string("\x50", 1), foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= std::string("\x50", 1))) { + throw kaitai::validation_less_than_error(std::string("\x50", 1), m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= std::string("\x50\x31", 2))) { - throw kaitai::validation_greater_than_error(std::string("\x50\x31", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= std::string("\x50\x31", 2))) { + throw kaitai::validation_greater_than_error(std::string("\x50\x31", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_range_float.cpp b/compiled/cpp_stl_11/valid_fail_range_float.cpp index aed0d0a9a..5c21fe02a 100644 --- a/compiled/cpp_stl_11/valid_fail_range_float.cpp +++ b/compiled/cpp_stl_11/valid_fail_range_float.cpp @@ -11,11 +11,11 @@ valid_fail_range_float_t::valid_fail_range_float_t(kaitai::kstream* p__io, kaita void valid_fail_range_float_t::_read() { m_foo = m__io->read_f4le(); - if (!(foo() >= 0.2)) { - throw kaitai::validation_less_than_error(0.2, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 0.2)) { + throw kaitai::validation_less_than_error(0.2, m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= 0.4)) { - throw kaitai::validation_greater_than_error(0.4, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 0.4)) { + throw kaitai::validation_greater_than_error(0.4, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_range_int.cpp b/compiled/cpp_stl_11/valid_fail_range_int.cpp index 512a787f7..ee53ab6cd 100644 --- a/compiled/cpp_stl_11/valid_fail_range_int.cpp +++ b/compiled/cpp_stl_11/valid_fail_range_int.cpp @@ -11,11 +11,11 @@ valid_fail_range_int_t::valid_fail_range_int_t(kaitai::kstream* p__io, kaitai::k void valid_fail_range_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() >= 5)) { - throw kaitai::validation_less_than_error(5, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 5)) { + throw kaitai::validation_less_than_error(5, m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= 10)) { - throw kaitai::validation_greater_than_error(10, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 10)) { + throw kaitai::validation_greater_than_error(10, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_range_str.cpp b/compiled/cpp_stl_11/valid_fail_range_str.cpp index 574240aa3..ee8fe67b0 100644 --- a/compiled/cpp_stl_11/valid_fail_range_str.cpp +++ b/compiled/cpp_stl_11/valid_fail_range_str.cpp @@ -11,11 +11,11 @@ valid_fail_range_str_t::valid_fail_range_str_t(kaitai::kstream* p__io, kaitai::k void valid_fail_range_str_t::_read() { m_foo = kaitai::kstream::bytes_to_str(m__io->read_bytes(2), "ASCII"); - if (!((foo().compare(std::string("P")) >= 0))) { - throw kaitai::validation_less_than_error(std::string("P"), foo(), _io(), std::string("/seq/0")); + if (!((m_foo.compare(std::string("P")) >= 0))) { + throw kaitai::validation_less_than_error(std::string("P"), m_foo, m__io, std::string("/seq/0")); } - if (!((foo().compare(std::string("P1")) <= 0))) { - throw kaitai::validation_greater_than_error(std::string("P1"), foo(), _io(), std::string("/seq/0")); + if (!((m_foo.compare(std::string("P1")) <= 0))) { + throw kaitai::validation_greater_than_error(std::string("P1"), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.cpp b/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.cpp new file mode 100644 index 000000000..9d08f0d72 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.cpp @@ -0,0 +1,32 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_anyof_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_anyof_int_t::valid_fail_repeat_anyof_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_anyof_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_anyof_int_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_u1())); + if (!( ((m_foo->at(i) == 0) || (m_foo->at(i) == 1) || (m_foo->at(i) == 65)) )) { + throw kaitai::validation_not_any_of_error(m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_anyof_int_t::~valid_fail_repeat_anyof_int_t() { + _clean_up(); +} + +void valid_fail_repeat_anyof_int_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.h b/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.h new file mode 100644 index 000000000..d28a5e178 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_anyof_int.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_anyof_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_anyof_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_anyof_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_anyof_int_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_anyof_int_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_anyof_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_anyof_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_contents.cpp b/compiled/cpp_stl_11/valid_fail_repeat_contents.cpp new file mode 100644 index 000000000..7f74cf8ae --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_contents.cpp @@ -0,0 +1,32 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_contents.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_contents_t::valid_fail_repeat_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_contents_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_contents_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_bytes(4))); + if (!(m_foo->at(i) == std::string("\x12\x34\x56\x78", 4))) { + throw kaitai::validation_not_equal_error(std::string("\x12\x34\x56\x78", 4), m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_contents_t::~valid_fail_repeat_contents_t() { + _clean_up(); +} + +void valid_fail_repeat_contents_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_contents.h b/compiled/cpp_stl_11/valid_fail_repeat_contents.h new file mode 100644 index 000000000..cde6f3b4d --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_contents.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_contents_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_contents_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_contents_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_contents_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_contents_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_contents_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_eq_int.cpp b/compiled/cpp_stl_11/valid_fail_repeat_eq_int.cpp new file mode 100644 index 000000000..64e4e1bee --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_eq_int.cpp @@ -0,0 +1,32 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_eq_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_eq_int_t::valid_fail_repeat_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_eq_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_eq_int_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_u4be())); + if (!(m_foo->at(i) == 305419896)) { + throw kaitai::validation_not_equal_error(305419896, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_eq_int_t::~valid_fail_repeat_eq_int_t() { + _clean_up(); +} + +void valid_fail_repeat_eq_int_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_eq_int.h b/compiled/cpp_stl_11/valid_fail_repeat_eq_int.h new file mode 100644 index 000000000..5a7ae2035 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_eq_int.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_eq_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_eq_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_eq_int_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_eq_int_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_eq_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_eq_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_expr.cpp b/compiled/cpp_stl_11/valid_fail_repeat_expr.cpp new file mode 100644 index 000000000..838883719 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_expr.cpp @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_expr.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_expr_t::valid_fail_repeat_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_expr_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_expr_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_bytes(4))); + { + std::string _ = m_foo->at(i); + if (!(_ != std::string("\x00\x12\x34\x56", 4))) { + throw kaitai::validation_expr_error(m_foo->at(i), m__io, std::string("/seq/0")); + } + } + i++; + } + } +} + +valid_fail_repeat_expr_t::~valid_fail_repeat_expr_t() { + _clean_up(); +} + +void valid_fail_repeat_expr_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_expr.h b/compiled/cpp_stl_11/valid_fail_repeat_expr.h new file mode 100644 index 000000000..eafbb6e3d --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_expr.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_expr_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_expr_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_expr_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_expr_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_expr_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_expr_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_inst.cpp b/compiled/cpp_stl_11/valid_fail_repeat_inst.cpp new file mode 100644 index 000000000..d888782df --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_inst.cpp @@ -0,0 +1,52 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_inst.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_inst_t::valid_fail_repeat_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_inst_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_inst = nullptr; + f_inst = false; + _read(); +} + +void valid_fail_repeat_inst_t::_read() { + n_a = true; + if (inst()->size() == 0) { + n_a = false; + m_a = m__io->read_bytes(0); + } +} + +valid_fail_repeat_inst_t::~valid_fail_repeat_inst_t() { + _clean_up(); +} + +void valid_fail_repeat_inst_t::_clean_up() { + if (!n_a) { + } + if (f_inst) { + } +} + +std::vector* valid_fail_repeat_inst_t::inst() { + if (f_inst) + return m_inst.get(); + std::streampos _pos = m__io->pos(); + m__io->seek(0); + m_inst = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_inst->push_back(std::move(m__io->read_u4be())); + if (!(m_inst->at(i) == 305419896)) { + throw kaitai::validation_not_equal_error(305419896, m_inst->at(i), m__io, std::string("/instances/inst")); + } + i++; + } + } + m__io->seek(_pos); + f_inst = true; + return m_inst.get(); +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_inst.h b/compiled/cpp_stl_11/valid_fail_repeat_inst.h new file mode 100644 index 000000000..5d72950b6 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_inst.h @@ -0,0 +1,51 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_inst_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_inst_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_inst_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_inst_t(); + +private: + bool f_inst; + std::unique_ptr> m_inst; + +public: + std::vector* inst(); + +private: + std::string m_a; + bool n_a; + +public: + bool _is_null_a() { a(); return n_a; }; + +private: + valid_fail_repeat_inst_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string a() const { return m_a; } + valid_fail_repeat_inst_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_max_int.cpp b/compiled/cpp_stl_11/valid_fail_repeat_max_int.cpp new file mode 100644 index 000000000..e4e358a5d --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_max_int.cpp @@ -0,0 +1,32 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_max_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_max_int_t::valid_fail_repeat_max_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_max_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_max_int_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_u1())); + if (!(m_foo->at(i) <= 254)) { + throw kaitai::validation_greater_than_error(254, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_max_int_t::~valid_fail_repeat_max_int_t() { + _clean_up(); +} + +void valid_fail_repeat_max_int_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_max_int.h b/compiled/cpp_stl_11/valid_fail_repeat_max_int.h new file mode 100644 index 000000000..7607f6fb3 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_max_int.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_max_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_max_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_max_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_max_int_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_max_int_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_max_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_max_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_fail_repeat_min_int.cpp b/compiled/cpp_stl_11/valid_fail_repeat_min_int.cpp new file mode 100644 index 000000000..e565d9365 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_min_int.cpp @@ -0,0 +1,32 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_min_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_min_int_t::valid_fail_repeat_min_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_min_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = nullptr; + _read(); +} + +void valid_fail_repeat_min_int_t::_read() { + m_foo = std::unique_ptr>(new std::vector()); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(std::move(m__io->read_s1())); + if (!(m_foo->at(i) >= 0)) { + throw kaitai::validation_less_than_error(0, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_min_int_t::~valid_fail_repeat_min_int_t() { + _clean_up(); +} + +void valid_fail_repeat_min_int_t::_clean_up() { +} diff --git a/compiled/cpp_stl_11/valid_fail_repeat_min_int.h b/compiled/cpp_stl_11/valid_fail_repeat_min_int.h new file mode 100644 index 000000000..fa47e9aa3 --- /dev/null +++ b/compiled/cpp_stl_11/valid_fail_repeat_min_int.h @@ -0,0 +1,38 @@ +#pragma once + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_min_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_min_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_min_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, valid_fail_repeat_min_int_t* p__root = nullptr); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_min_int_t(); + +private: + std::unique_ptr> m_foo; + valid_fail_repeat_min_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo.get(); } + valid_fail_repeat_min_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; diff --git a/compiled/cpp_stl_11/valid_long.cpp b/compiled/cpp_stl_11/valid_long.cpp index ff374a70f..da00cbf46 100644 --- a/compiled/cpp_stl_11/valid_long.cpp +++ b/compiled/cpp_stl_11/valid_long.cpp @@ -11,48 +11,48 @@ valid_long_t::valid_long_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, v void valid_long_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); - if (!(uint8() == 255)) { - throw kaitai::validation_not_equal_error(255, uint8(), _io(), std::string("/seq/1")); + if (!(m_uint8 == 255)) { + throw kaitai::validation_not_equal_error(255, m_uint8, m__io, std::string("/seq/1")); } m_sint8 = m__io->read_s1(); - if (!(sint8() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint8(), _io(), std::string("/seq/2")); + if (!(m_sint8 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint8, m__io, std::string("/seq/2")); } m_magic_uint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_uint() == (std::string("PACK-U-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == (std::string("PACK-U-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); - if (!(uint16() == 65535)) { - throw kaitai::validation_not_equal_error(65535, uint16(), _io(), std::string("/seq/4")); + if (!(m_uint16 == 65535)) { + throw kaitai::validation_not_equal_error(65535, m_uint16, m__io, std::string("/seq/4")); } m_uint32 = m__io->read_u4le(); - if (!(uint32() == 4294967295UL)) { - throw kaitai::validation_not_equal_error(4294967295UL, uint32(), _io(), std::string("/seq/5")); + if (!(m_uint32 == 4294967295UL)) { + throw kaitai::validation_not_equal_error(4294967295UL, m_uint32, m__io, std::string("/seq/5")); } m_uint64 = m__io->read_u8le(); - if (!(uint64() == 18446744073709551615ULL)) { - throw kaitai::validation_not_equal_error(18446744073709551615ULL, uint64(), _io(), std::string("/seq/6")); + if (!(m_uint64 == 18446744073709551615ULL)) { + throw kaitai::validation_not_equal_error(18446744073709551615ULL, m_uint64, m__io, std::string("/seq/6")); } m_magic_sint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_sint() == (std::string("PACK-S-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == (std::string("PACK-S-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); - if (!(sint16() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint16(), _io(), std::string("/seq/8")); + if (!(m_sint16 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint16, m__io, std::string("/seq/8")); } m_sint32 = m__io->read_s4le(); - if (!(sint32() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint32(), _io(), std::string("/seq/9")); + if (!(m_sint32 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint32, m__io, std::string("/seq/9")); } m_sint64 = m__io->read_s8le(); - if (!(sint64() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint64(), _io(), std::string("/seq/10")); + if (!(m_sint64 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint64, m__io, std::string("/seq/10")); } } diff --git a/compiled/cpp_stl_11/valid_not_parsed_if.cpp b/compiled/cpp_stl_11/valid_not_parsed_if.cpp index bc92cc875..5fe6b6e7b 100644 --- a/compiled/cpp_stl_11/valid_not_parsed_if.cpp +++ b/compiled/cpp_stl_11/valid_not_parsed_if.cpp @@ -14,16 +14,16 @@ void valid_not_parsed_if_t::_read() { if (false) { n_not_parsed = false; m_not_parsed = m__io->read_u1(); - if (!(not_parsed() == 42)) { - throw kaitai::validation_not_equal_error(42, not_parsed(), _io(), std::string("/seq/0")); + if (!(m_not_parsed == 42)) { + throw kaitai::validation_not_equal_error(42, m_not_parsed, m__io, std::string("/seq/0")); } } n_parsed = true; if (true) { n_parsed = false; m_parsed = m__io->read_u1(); - if (!(parsed() == 80)) { - throw kaitai::validation_not_equal_error(80, parsed(), _io(), std::string("/seq/1")); + if (!(m_parsed == 80)) { + throw kaitai::validation_not_equal_error(80, m_parsed, m__io, std::string("/seq/1")); } } } diff --git a/compiled/cpp_stl_11/valid_optional_id.cpp b/compiled/cpp_stl_11/valid_optional_id.cpp index b4dd00096..7ebb81d9b 100644 --- a/compiled/cpp_stl_11/valid_optional_id.cpp +++ b/compiled/cpp_stl_11/valid_optional_id.cpp @@ -11,18 +11,18 @@ valid_optional_id_t::valid_optional_id_t(kaitai::kstream* p__io, kaitai::kstruct void valid_optional_id_t::_read() { m__unnamed0 = m__io->read_bytes(6); - if (!(_unnamed0() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), _unnamed0(), _io(), std::string("/seq/0")); + if (!(m__unnamed0 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m__unnamed0, m__io, std::string("/seq/0")); } m__unnamed1 = m__io->read_u1(); - if (!(_unnamed1() == 255)) { - throw kaitai::validation_not_equal_error(255, _unnamed1(), _io(), std::string("/seq/1")); + if (!(m__unnamed1 == 255)) { + throw kaitai::validation_not_equal_error(255, m__unnamed1, m__io, std::string("/seq/1")); } m__unnamed2 = m__io->read_s1(); { - int8_t _ = _unnamed2(); + int8_t _ = m__unnamed2; if (!(_ == -1)) { - throw kaitai::validation_expr_error(_unnamed2(), _io(), std::string("/seq/2")); + throw kaitai::validation_expr_error(m__unnamed2, m__io, std::string("/seq/2")); } } } diff --git a/compiled/cpp_stl_11/valid_short.cpp b/compiled/cpp_stl_11/valid_short.cpp index c7257c325..82331d74e 100644 --- a/compiled/cpp_stl_11/valid_short.cpp +++ b/compiled/cpp_stl_11/valid_short.cpp @@ -11,48 +11,48 @@ valid_short_t::valid_short_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, void valid_short_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); - if (!(uint8() == 255)) { - throw kaitai::validation_not_equal_error(255, uint8(), _io(), std::string("/seq/1")); + if (!(m_uint8 == 255)) { + throw kaitai::validation_not_equal_error(255, m_uint8, m__io, std::string("/seq/1")); } m_sint8 = m__io->read_s1(); - if (!(sint8() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint8(), _io(), std::string("/seq/2")); + if (!(m_sint8 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint8, m__io, std::string("/seq/2")); } m_magic_uint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_uint() == (std::string("PACK-U-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == (std::string("PACK-U-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); - if (!(uint16() == 65535)) { - throw kaitai::validation_not_equal_error(65535, uint16(), _io(), std::string("/seq/4")); + if (!(m_uint16 == 65535)) { + throw kaitai::validation_not_equal_error(65535, m_uint16, m__io, std::string("/seq/4")); } m_uint32 = m__io->read_u4le(); - if (!(uint32() == 4294967295UL)) { - throw kaitai::validation_not_equal_error(4294967295UL, uint32(), _io(), std::string("/seq/5")); + if (!(m_uint32 == 4294967295UL)) { + throw kaitai::validation_not_equal_error(4294967295UL, m_uint32, m__io, std::string("/seq/5")); } m_uint64 = m__io->read_u8le(); - if (!(uint64() == 18446744073709551615ULL)) { - throw kaitai::validation_not_equal_error(18446744073709551615ULL, uint64(), _io(), std::string("/seq/6")); + if (!(m_uint64 == 18446744073709551615ULL)) { + throw kaitai::validation_not_equal_error(18446744073709551615ULL, m_uint64, m__io, std::string("/seq/6")); } m_magic_sint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_sint() == (std::string("PACK-S-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == (std::string("PACK-S-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); - if (!(sint16() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint16(), _io(), std::string("/seq/8")); + if (!(m_sint16 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint16, m__io, std::string("/seq/8")); } m_sint32 = m__io->read_s4le(); - if (!(sint32() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint32(), _io(), std::string("/seq/9")); + if (!(m_sint32 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint32, m__io, std::string("/seq/9")); } m_sint64 = m__io->read_s8le(); - if (!(sint64() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint64(), _io(), std::string("/seq/10")); + if (!(m_sint64 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint64, m__io, std::string("/seq/10")); } } diff --git a/compiled/cpp_stl_11/valid_switch.cpp b/compiled/cpp_stl_11/valid_switch.cpp index 89d997fb8..ed7cd4db4 100644 --- a/compiled/cpp_stl_11/valid_switch.cpp +++ b/compiled/cpp_stl_11/valid_switch.cpp @@ -11,8 +11,8 @@ valid_switch_t::valid_switch_t(kaitai::kstream* p__io, kaitai::kstruct* p__paren void valid_switch_t::_read() { m_a = m__io->read_u1(); - if (!(a() == 80)) { - throw kaitai::validation_not_equal_error(80, a(), _io(), std::string("/seq/0")); + if (!(m_a == 80)) { + throw kaitai::validation_not_equal_error(80, m_a, m__io, std::string("/seq/0")); } switch (a()) { case 80: { @@ -24,8 +24,8 @@ void valid_switch_t::_read() { break; } } - if (!(b() == 17217)) { - throw kaitai::validation_not_equal_error(17217, b(), _io(), std::string("/seq/1")); + if (!(m_b == 17217)) { + throw kaitai::validation_not_equal_error(17217, m_b, m__io, std::string("/seq/1")); } } diff --git a/compiled/cpp_stl_98/fixed_contents.cpp b/compiled/cpp_stl_98/fixed_contents.cpp index 27835df0f..cb6ae03d2 100644 --- a/compiled/cpp_stl_98/fixed_contents.cpp +++ b/compiled/cpp_stl_98/fixed_contents.cpp @@ -17,12 +17,12 @@ fixed_contents_t::fixed_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__p void fixed_contents_t::_read() { m_normal = m__io->read_bytes(6); - if (!(normal() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), normal(), _io(), std::string("/seq/0")); + if (!(m_normal == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_normal, m__io, std::string("/seq/0")); } m_high_bit_8 = m__io->read_bytes(2); - if (!(high_bit_8() == std::string("\xFF\xFF", 2))) { - throw kaitai::validation_not_equal_error(std::string("\xFF\xFF", 2), high_bit_8(), _io(), std::string("/seq/1")); + if (!(m_high_bit_8 == std::string("\xFF\xFF", 2))) { + throw kaitai::validation_not_equal_error(std::string("\xFF\xFF", 2), m_high_bit_8, m__io, std::string("/seq/1")); } } diff --git a/compiled/cpp_stl_98/fixed_struct.cpp b/compiled/cpp_stl_98/fixed_struct.cpp index 5bdd4a5bf..134d80eea 100644 --- a/compiled/cpp_stl_98/fixed_struct.cpp +++ b/compiled/cpp_stl_98/fixed_struct.cpp @@ -46,49 +46,49 @@ fixed_struct_t::header_t::header_t(kaitai::kstream* p__io, fixed_struct_t* p__pa void fixed_struct_t::header_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/types/header/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/types/header/seq/0")); } m_uint8 = m__io->read_u1(); m_sint8 = m__io->read_s1(); m_magic_uint = m__io->read_bytes(10); - if (!(magic_uint() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), magic_uint(), _io(), std::string("/types/header/seq/3")); + if (!(m_magic_uint == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), m_magic_uint, m__io, std::string("/types/header/seq/3")); } m_uint16 = m__io->read_u2le(); m_uint32 = m__io->read_u4le(); m_uint64 = m__io->read_u8le(); m_magic_sint = m__io->read_bytes(10); - if (!(magic_sint() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), magic_sint(), _io(), std::string("/types/header/seq/7")); + if (!(m_magic_sint == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), m_magic_sint, m__io, std::string("/types/header/seq/7")); } m_sint16 = m__io->read_s2le(); m_sint32 = m__io->read_s4le(); m_sint64 = m__io->read_s8le(); m_magic_uint_le = m__io->read_bytes(9); - if (!(magic_uint_le() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), magic_uint_le(), _io(), std::string("/types/header/seq/11")); + if (!(m_magic_uint_le == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), m_magic_uint_le, m__io, std::string("/types/header/seq/11")); } m_uint16le = m__io->read_u2le(); m_uint32le = m__io->read_u4le(); m_uint64le = m__io->read_u8le(); m_magic_sint_le = m__io->read_bytes(9); - if (!(magic_sint_le() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), magic_sint_le(), _io(), std::string("/types/header/seq/15")); + if (!(m_magic_sint_le == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), m_magic_sint_le, m__io, std::string("/types/header/seq/15")); } m_sint16le = m__io->read_s2le(); m_sint32le = m__io->read_s4le(); m_sint64le = m__io->read_s8le(); m_magic_uint_be = m__io->read_bytes(9); - if (!(magic_uint_be() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), magic_uint_be(), _io(), std::string("/types/header/seq/19")); + if (!(m_magic_uint_be == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), m_magic_uint_be, m__io, std::string("/types/header/seq/19")); } m_uint16be = m__io->read_u2be(); m_uint32be = m__io->read_u4be(); m_uint64be = m__io->read_u8be(); m_magic_sint_be = m__io->read_bytes(9); - if (!(magic_sint_be() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), magic_sint_be(), _io(), std::string("/types/header/seq/23")); + if (!(m_magic_sint_be == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), m_magic_sint_be, m__io, std::string("/types/header/seq/23")); } m_sint16be = m__io->read_s2be(); m_sint32be = m__io->read_s4be(); diff --git a/compiled/cpp_stl_98/integers.cpp b/compiled/cpp_stl_98/integers.cpp index db360e9fe..6202e6f45 100644 --- a/compiled/cpp_stl_98/integers.cpp +++ b/compiled/cpp_stl_98/integers.cpp @@ -17,49 +17,49 @@ integers_t::integers_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, integ void integers_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); m_sint8 = m__io->read_s1(); m_magic_uint = m__io->read_bytes(10); - if (!(magic_uint() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", 10), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); m_uint32 = m__io->read_u4le(); m_uint64 = m__io->read_u8le(); m_magic_sint = m__io->read_bytes(10); - if (!(magic_sint() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", 10), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); m_sint32 = m__io->read_s4le(); m_sint64 = m__io->read_s8le(); m_magic_uint_le = m__io->read_bytes(9); - if (!(magic_uint_le() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), magic_uint_le(), _io(), std::string("/seq/11")); + if (!(m_magic_uint_le == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", 9), m_magic_uint_le, m__io, std::string("/seq/11")); } m_uint16le = m__io->read_u2le(); m_uint32le = m__io->read_u4le(); m_uint64le = m__io->read_u8le(); m_magic_sint_le = m__io->read_bytes(9); - if (!(magic_sint_le() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), magic_sint_le(), _io(), std::string("/seq/15")); + if (!(m_magic_sint_le == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", 9), m_magic_sint_le, m__io, std::string("/seq/15")); } m_sint16le = m__io->read_s2le(); m_sint32le = m__io->read_s4le(); m_sint64le = m__io->read_s8le(); m_magic_uint_be = m__io->read_bytes(9); - if (!(magic_uint_be() == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), magic_uint_be(), _io(), std::string("/seq/19")); + if (!(m_magic_uint_be == std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", 9), m_magic_uint_be, m__io, std::string("/seq/19")); } m_uint16be = m__io->read_u2be(); m_uint32be = m__io->read_u4be(); m_uint64be = m__io->read_u8be(); m_magic_sint_be = m__io->read_bytes(9); - if (!(magic_sint_be() == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), magic_sint_be(), _io(), std::string("/seq/23")); + if (!(m_magic_sint_be == std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", 9), m_magic_sint_be, m__io, std::string("/seq/23")); } m_sint16be = m__io->read_s2be(); m_sint32be = m__io->read_s4be(); diff --git a/compiled/cpp_stl_98/str_pad_term_utf16.cpp b/compiled/cpp_stl_98/str_pad_term_utf16.cpp new file mode 100644 index 000000000..cc679c350 --- /dev/null +++ b/compiled/cpp_stl_98/str_pad_term_utf16.cpp @@ -0,0 +1,28 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "str_pad_term_utf16.h" + +str_pad_term_utf16_t::str_pad_term_utf16_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, str_pad_term_utf16_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void str_pad_term_utf16_t::_read() { + m_str_term = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(m__io->read_bytes(10), std::string("\x00\x00", 2), false), "UTF-16LE"); + m_str_term_include = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(m__io->read_bytes(10), std::string("\x00\x00", 2), true), "UTF-16LE"); + m_str_term_and_pad = kaitai::kstream::bytes_to_str(kaitai::kstream::bytes_terminate_multi(kaitai::kstream::bytes_strip_right(m__io->read_bytes(9), 43), std::string("\x00\x00", 2), false), "UTF-16LE"); +} + +str_pad_term_utf16_t::~str_pad_term_utf16_t() { + _clean_up(); +} + +void str_pad_term_utf16_t::_clean_up() { +} diff --git a/compiled/cpp_stl_98/str_pad_term_utf16.h b/compiled/cpp_stl_98/str_pad_term_utf16.h new file mode 100644 index 000000000..ce86e4e11 --- /dev/null +++ b/compiled/cpp_stl_98/str_pad_term_utf16.h @@ -0,0 +1,43 @@ +#ifndef STR_PAD_TERM_UTF16_H_ +#define STR_PAD_TERM_UTF16_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class str_pad_term_utf16_t; + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class str_pad_term_utf16_t : public kaitai::kstruct { + +public: + + str_pad_term_utf16_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, str_pad_term_utf16_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~str_pad_term_utf16_t(); + +private: + std::string m_str_term; + std::string m_str_term_include; + std::string m_str_term_and_pad; + str_pad_term_utf16_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string str_term() const { return m_str_term; } + std::string str_term_include() const { return m_str_term_include; } + std::string str_term_and_pad() const { return m_str_term_and_pad; } + str_pad_term_utf16_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // STR_PAD_TERM_UTF16_H_ diff --git a/compiled/cpp_stl_98/term_strz_utf16_v1.cpp b/compiled/cpp_stl_98/term_strz_utf16_v1.cpp new file mode 100644 index 000000000..c9775053e --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v1.cpp @@ -0,0 +1,29 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v1.h" + +term_strz_utf16_v1_t::term_strz_utf16_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v1_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v1_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_term = m__io->read_u2le(); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, true), "UTF-16LE"); +} + +term_strz_utf16_v1_t::~term_strz_utf16_v1_t() { + _clean_up(); +} + +void term_strz_utf16_v1_t::_clean_up() { +} diff --git a/compiled/cpp_stl_98/term_strz_utf16_v1.h b/compiled/cpp_stl_98/term_strz_utf16_v1.h new file mode 100644 index 000000000..a7cb9b26f --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v1.h @@ -0,0 +1,45 @@ +#ifndef TERM_STRZ_UTF16_V1_H_ +#define TERM_STRZ_UTF16_V1_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v1_t; + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v1_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, term_strz_utf16_v1_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v1_t(); + +private: + std::string m_s1; + std::string m_s2; + uint16_t m_term; + std::string m_s3; + term_strz_utf16_v1_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + std::string s2() const { return m_s2; } + uint16_t term() const { return m_term; } + std::string s3() const { return m_s3; } + term_strz_utf16_v1_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // TERM_STRZ_UTF16_V1_H_ diff --git a/compiled/cpp_stl_98/term_strz_utf16_v2.cpp b/compiled/cpp_stl_98/term_strz_utf16_v2.cpp new file mode 100644 index 000000000..133aabf5e --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v2.cpp @@ -0,0 +1,28 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v2.h" + +term_strz_utf16_v2_t::term_strz_utf16_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v2_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v2_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, true), "UTF-16LE"); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); +} + +term_strz_utf16_v2_t::~term_strz_utf16_v2_t() { + _clean_up(); +} + +void term_strz_utf16_v2_t::_clean_up() { +} diff --git a/compiled/cpp_stl_98/term_strz_utf16_v2.h b/compiled/cpp_stl_98/term_strz_utf16_v2.h new file mode 100644 index 000000000..22484fcdd --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v2.h @@ -0,0 +1,43 @@ +#ifndef TERM_STRZ_UTF16_V2_H_ +#define TERM_STRZ_UTF16_V2_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v2_t; + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v2_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, term_strz_utf16_v2_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v2_t(); + +private: + std::string m_s1; + std::string m_s2; + std::string m_s3; + term_strz_utf16_v2_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + std::string s2() const { return m_s2; } + std::string s3() const { return m_s3; } + term_strz_utf16_v2_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // TERM_STRZ_UTF16_V2_H_ diff --git a/compiled/cpp_stl_98/term_strz_utf16_v3.cpp b/compiled/cpp_stl_98/term_strz_utf16_v3.cpp new file mode 100644 index 000000000..32814052e --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v3.cpp @@ -0,0 +1,29 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v3.h" + +term_strz_utf16_v3_t::term_strz_utf16_v3_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v3_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v3_t::_read() { + m_s1 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_term = m__io->read_u2le(); + m_s2 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, true), "UTF-16LE"); + m_s3 = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, true), "UTF-16LE"); +} + +term_strz_utf16_v3_t::~term_strz_utf16_v3_t() { + _clean_up(); +} + +void term_strz_utf16_v3_t::_clean_up() { +} diff --git a/compiled/cpp_stl_98/term_strz_utf16_v3.h b/compiled/cpp_stl_98/term_strz_utf16_v3.h new file mode 100644 index 000000000..441edc64f --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v3.h @@ -0,0 +1,45 @@ +#ifndef TERM_STRZ_UTF16_V3_H_ +#define TERM_STRZ_UTF16_V3_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v3_t; + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v3_t : public kaitai::kstruct { + +public: + + term_strz_utf16_v3_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, term_strz_utf16_v3_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v3_t(); + +private: + std::string m_s1; + uint16_t m_term; + std::string m_s2; + std::string m_s3; + term_strz_utf16_v3_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string s1() const { return m_s1; } + uint16_t term() const { return m_term; } + std::string s2() const { return m_s2; } + std::string s3() const { return m_s3; } + term_strz_utf16_v3_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // TERM_STRZ_UTF16_V3_H_ diff --git a/compiled/cpp_stl_98/term_strz_utf16_v4.cpp b/compiled/cpp_stl_98/term_strz_utf16_v4.cpp new file mode 100644 index 000000000..e4997e10f --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v4.cpp @@ -0,0 +1,129 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "term_strz_utf16_v4.h" + +term_strz_utf16_v4_t::term_strz_utf16_v4_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_s1 = 0; + m__io__raw_s1 = 0; + m_s2 = 0; + m__io__raw_s2 = 0; + m_s3 = 0; + m__io__raw_s3 = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v4_t::_read() { + m__raw_s1 = m__io->read_bytes(6); + m__io__raw_s1 = new kaitai::kstream(m__raw_s1); + m_s1 = new s1_type_t(m__io__raw_s1, this, m__root); + m_skip_term1 = m__io->read_bytes(2); + m__raw_s2 = m__io->read_bytes(6); + m__io__raw_s2 = new kaitai::kstream(m__raw_s2); + m_s2 = new s2_type_t(m__io__raw_s2, this, m__root); + m_skip_term2 = m__io->read_bytes(2); + m__raw_s3 = m__io->read_bytes(6); + m__io__raw_s3 = new kaitai::kstream(m__raw_s3); + m_s3 = new s3_type_t(m__io__raw_s3, this, m__root); +} + +term_strz_utf16_v4_t::~term_strz_utf16_v4_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::_clean_up() { + if (m__io__raw_s1) { + delete m__io__raw_s1; m__io__raw_s1 = 0; + } + if (m_s1) { + delete m_s1; m_s1 = 0; + } + if (m__io__raw_s2) { + delete m__io__raw_s2; m__io__raw_s2 = 0; + } + if (m_s2) { + delete m_s2; m_s2 = 0; + } + if (m__io__raw_s3) { + delete m__io__raw_s3; m__io__raw_s3 = 0; + } + if (m_s3) { + delete m_s3; m_s3 = 0; + } +} + +term_strz_utf16_v4_t::s1_type_t::s1_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v4_t::s1_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, true, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s1_type_t::~s1_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s1_type_t::_clean_up() { +} + +term_strz_utf16_v4_t::s2_type_t::s2_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v4_t::s2_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), false, false, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s2_type_t::~s2_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s2_type_t::_clean_up() { +} + +term_strz_utf16_v4_t::s3_type_t::s3_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent, term_strz_utf16_v4_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void term_strz_utf16_v4_t::s3_type_t::_read() { + m_value = kaitai::kstream::bytes_to_str(m__io->read_bytes_term_multi(std::string("\x00\x00", 2), true, true, false), "UTF-16LE"); +} + +term_strz_utf16_v4_t::s3_type_t::~s3_type_t() { + _clean_up(); +} + +void term_strz_utf16_v4_t::s3_type_t::_clean_up() { +} diff --git a/compiled/cpp_stl_98/term_strz_utf16_v4.h b/compiled/cpp_stl_98/term_strz_utf16_v4.h new file mode 100644 index 000000000..67acde12f --- /dev/null +++ b/compiled/cpp_stl_98/term_strz_utf16_v4.h @@ -0,0 +1,134 @@ +#ifndef TERM_STRZ_UTF16_V4_H_ +#define TERM_STRZ_UTF16_V4_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class term_strz_utf16_v4_t; + +#include "kaitai/kaitaistruct.h" +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class term_strz_utf16_v4_t : public kaitai::kstruct { + +public: + class s1_type_t; + class s2_type_t; + class s3_type_t; + + term_strz_utf16_v4_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, term_strz_utf16_v4_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~term_strz_utf16_v4_t(); + + class s1_type_t : public kaitai::kstruct { + + public: + + s1_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = 0, term_strz_utf16_v4_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~s1_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + + class s2_type_t : public kaitai::kstruct { + + public: + + s2_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = 0, term_strz_utf16_v4_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~s2_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + + class s3_type_t : public kaitai::kstruct { + + public: + + s3_type_t(kaitai::kstream* p__io, term_strz_utf16_v4_t* p__parent = 0, term_strz_utf16_v4_t* p__root = 0); + + private: + void _read(); + void _clean_up(); + + public: + ~s3_type_t(); + + private: + std::string m_value; + term_strz_utf16_v4_t* m__root; + term_strz_utf16_v4_t* m__parent; + + public: + std::string value() const { return m_value; } + term_strz_utf16_v4_t* _root() const { return m__root; } + term_strz_utf16_v4_t* _parent() const { return m__parent; } + }; + +private: + s1_type_t* m_s1; + std::string m_skip_term1; + s2_type_t* m_s2; + std::string m_skip_term2; + s3_type_t* m_s3; + term_strz_utf16_v4_t* m__root; + kaitai::kstruct* m__parent; + std::string m__raw_s1; + kaitai::kstream* m__io__raw_s1; + std::string m__raw_s2; + kaitai::kstream* m__io__raw_s2; + std::string m__raw_s3; + kaitai::kstream* m__io__raw_s3; + +public: + s1_type_t* s1() const { return m_s1; } + std::string skip_term1() const { return m_skip_term1; } + s2_type_t* s2() const { return m_s2; } + std::string skip_term2() const { return m_skip_term2; } + s3_type_t* s3() const { return m_s3; } + term_strz_utf16_v4_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } + std::string _raw_s1() const { return m__raw_s1; } + kaitai::kstream* _io__raw_s1() const { return m__io__raw_s1; } + std::string _raw_s2() const { return m__raw_s2; } + kaitai::kstream* _io__raw_s2() const { return m__io__raw_s2; } + std::string _raw_s3() const { return m__raw_s3; } + kaitai::kstream* _io__raw_s3() const { return m__io__raw_s3; } +}; + +#endif // TERM_STRZ_UTF16_V4_H_ diff --git a/compiled/cpp_stl_98/valid_eq_str_encodings.cpp b/compiled/cpp_stl_98/valid_eq_str_encodings.cpp index 545a712de..ba1342f63 100644 --- a/compiled/cpp_stl_98/valid_eq_str_encodings.cpp +++ b/compiled/cpp_stl_98/valid_eq_str_encodings.cpp @@ -18,23 +18,23 @@ valid_eq_str_encodings_t::valid_eq_str_encodings_t(kaitai::kstream* p__io, kaita void valid_eq_str_encodings_t::_read() { m_len_of_1 = m__io->read_u2le(); m_str1 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_1()), "ASCII"); - if (!(str1() == (std::string("Some ASCII")))) { - throw kaitai::validation_not_equal_error(std::string("Some ASCII"), str1(), _io(), std::string("/seq/1")); + if (!(m_str1 == (std::string("Some ASCII")))) { + throw kaitai::validation_not_equal_error(std::string("Some ASCII"), m_str1, m__io, std::string("/seq/1")); } m_len_of_2 = m__io->read_u2le(); m_str2 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_2()), "UTF-8"); - if (!(str2() == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { - throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), str2(), _io(), std::string("/seq/3")); + if (!(m_str2 == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { + throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), m_str2, m__io, std::string("/seq/3")); } m_len_of_3 = m__io->read_u2le(); m_str3 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_3()), "SJIS"); - if (!(str3() == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { - throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), str3(), _io(), std::string("/seq/5")); + if (!(m_str3 == (std::string("\u3053\u3093\u306b\u3061\u306f")))) { + throw kaitai::validation_not_equal_error(std::string("\u3053\u3093\u306b\u3061\u306f"), m_str3, m__io, std::string("/seq/5")); } m_len_of_4 = m__io->read_u2le(); m_str4 = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_of_4()), "IBM437"); - if (!(str4() == (std::string("\u2591\u2592\u2593")))) { - throw kaitai::validation_not_equal_error(std::string("\u2591\u2592\u2593"), str4(), _io(), std::string("/seq/7")); + if (!(m_str4 == (std::string("\u2591\u2592\u2593")))) { + throw kaitai::validation_not_equal_error(std::string("\u2591\u2592\u2593"), m_str4, m__io, std::string("/seq/7")); } } diff --git a/compiled/cpp_stl_98/valid_fail_anyof_int.cpp b/compiled/cpp_stl_98/valid_fail_anyof_int.cpp index e80306d84..f66b9248d 100644 --- a/compiled/cpp_stl_98/valid_fail_anyof_int.cpp +++ b/compiled/cpp_stl_98/valid_fail_anyof_int.cpp @@ -17,8 +17,8 @@ valid_fail_anyof_int_t::valid_fail_anyof_int_t(kaitai::kstream* p__io, kaitai::k void valid_fail_anyof_int_t::_read() { m_foo = m__io->read_u1(); - if (!( ((foo() == 5) || (foo() == 6) || (foo() == 7) || (foo() == 8) || (foo() == 10) || (foo() == 11) || (foo() == 12) || (foo() == 47)) )) { - throw kaitai::validation_not_any_of_error(foo(), _io(), std::string("/seq/0")); + if (!( ((m_foo == 5) || (m_foo == 6) || (m_foo == 7) || (m_foo == 8) || (m_foo == 10) || (m_foo == 11) || (m_foo == 12) || (m_foo == 47)) )) { + throw kaitai::validation_not_any_of_error(m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_contents.cpp b/compiled/cpp_stl_98/valid_fail_contents.cpp index 890cf3995..23f86769c 100644 --- a/compiled/cpp_stl_98/valid_fail_contents.cpp +++ b/compiled/cpp_stl_98/valid_fail_contents.cpp @@ -17,8 +17,8 @@ valid_fail_contents_t::valid_fail_contents_t(kaitai::kstream* p__io, kaitai::kst void valid_fail_contents_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() == std::string("\x51\x41", 2))) { - throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == std::string("\x51\x41", 2))) { + throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_eq_bytes.cpp b/compiled/cpp_stl_98/valid_fail_eq_bytes.cpp index 377bf1586..e5f2eb739 100644 --- a/compiled/cpp_stl_98/valid_fail_eq_bytes.cpp +++ b/compiled/cpp_stl_98/valid_fail_eq_bytes.cpp @@ -17,8 +17,8 @@ valid_fail_eq_bytes_t::valid_fail_eq_bytes_t(kaitai::kstream* p__io, kaitai::kst void valid_fail_eq_bytes_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() == std::string("\x51\x41", 2))) { - throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == std::string("\x51\x41", 2))) { + throw kaitai::validation_not_equal_error(std::string("\x51\x41", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_eq_int.cpp b/compiled/cpp_stl_98/valid_fail_eq_int.cpp index aca392197..4380840fb 100644 --- a/compiled/cpp_stl_98/valid_fail_eq_int.cpp +++ b/compiled/cpp_stl_98/valid_fail_eq_int.cpp @@ -17,8 +17,8 @@ valid_fail_eq_int_t::valid_fail_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct void valid_fail_eq_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() == 123)) { - throw kaitai::validation_not_equal_error(123, foo(), _io(), std::string("/seq/0")); + if (!(m_foo == 123)) { + throw kaitai::validation_not_equal_error(123, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_eq_str.cpp b/compiled/cpp_stl_98/valid_fail_eq_str.cpp index 716277f58..6089412e1 100644 --- a/compiled/cpp_stl_98/valid_fail_eq_str.cpp +++ b/compiled/cpp_stl_98/valid_fail_eq_str.cpp @@ -17,8 +17,8 @@ valid_fail_eq_str_t::valid_fail_eq_str_t(kaitai::kstream* p__io, kaitai::kstruct void valid_fail_eq_str_t::_read() { m_foo = kaitai::kstream::bytes_to_str(m__io->read_bytes(4), "ASCII"); - if (!(foo() == (std::string("BACK")))) { - throw kaitai::validation_not_equal_error(std::string("BACK"), foo(), _io(), std::string("/seq/0")); + if (!(m_foo == (std::string("BACK")))) { + throw kaitai::validation_not_equal_error(std::string("BACK"), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_expr.cpp b/compiled/cpp_stl_98/valid_fail_expr.cpp index a348458c5..d5d640b76 100644 --- a/compiled/cpp_stl_98/valid_fail_expr.cpp +++ b/compiled/cpp_stl_98/valid_fail_expr.cpp @@ -18,16 +18,16 @@ valid_fail_expr_t::valid_fail_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p_ void valid_fail_expr_t::_read() { m_foo = m__io->read_u1(); { - uint8_t _ = foo(); + uint8_t _ = m_foo; if (!(_ == 1)) { - throw kaitai::validation_expr_error(foo(), _io(), std::string("/seq/0")); + throw kaitai::validation_expr_error(m_foo, m__io, std::string("/seq/0")); } } m_bar = m__io->read_s2le(); { - int16_t _ = bar(); + int16_t _ = m_bar; if (!( ((_ < -190) || (_ > -190)) )) { - throw kaitai::validation_expr_error(bar(), _io(), std::string("/seq/1")); + throw kaitai::validation_expr_error(m_bar, m__io, std::string("/seq/1")); } } } diff --git a/compiled/cpp_stl_98/valid_fail_inst.cpp b/compiled/cpp_stl_98/valid_fail_inst.cpp index 5430af145..6abbb3fbd 100644 --- a/compiled/cpp_stl_98/valid_fail_inst.cpp +++ b/compiled/cpp_stl_98/valid_fail_inst.cpp @@ -41,10 +41,10 @@ uint8_t valid_fail_inst_t::inst() { std::streampos _pos = m__io->pos(); m__io->seek(5); m_inst = m__io->read_u1(); + if (!(m_inst == 80)) { + throw kaitai::validation_not_equal_error(80, m_inst, m__io, std::string("/instances/inst")); + } m__io->seek(_pos); f_inst = true; - if (!(inst() == 80)) { - throw kaitai::validation_not_equal_error(80, inst(), _io(), std::string("/instances/inst")); - } return m_inst; } diff --git a/compiled/cpp_stl_98/valid_fail_max_int.cpp b/compiled/cpp_stl_98/valid_fail_max_int.cpp index cb17328f2..609ac18fd 100644 --- a/compiled/cpp_stl_98/valid_fail_max_int.cpp +++ b/compiled/cpp_stl_98/valid_fail_max_int.cpp @@ -17,8 +17,8 @@ valid_fail_max_int_t::valid_fail_max_int_t(kaitai::kstream* p__io, kaitai::kstru void valid_fail_max_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() <= 12)) { - throw kaitai::validation_greater_than_error(12, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 12)) { + throw kaitai::validation_greater_than_error(12, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_min_int.cpp b/compiled/cpp_stl_98/valid_fail_min_int.cpp index 44eb5bd35..3ac584207 100644 --- a/compiled/cpp_stl_98/valid_fail_min_int.cpp +++ b/compiled/cpp_stl_98/valid_fail_min_int.cpp @@ -17,8 +17,8 @@ valid_fail_min_int_t::valid_fail_min_int_t(kaitai::kstream* p__io, kaitai::kstru void valid_fail_min_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() >= 123)) { - throw kaitai::validation_less_than_error(123, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 123)) { + throw kaitai::validation_less_than_error(123, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_range_bytes.cpp b/compiled/cpp_stl_98/valid_fail_range_bytes.cpp index 1fab4c2ba..d04b700a4 100644 --- a/compiled/cpp_stl_98/valid_fail_range_bytes.cpp +++ b/compiled/cpp_stl_98/valid_fail_range_bytes.cpp @@ -17,11 +17,11 @@ valid_fail_range_bytes_t::valid_fail_range_bytes_t(kaitai::kstream* p__io, kaita void valid_fail_range_bytes_t::_read() { m_foo = m__io->read_bytes(2); - if (!(foo() >= std::string("\x50", 1))) { - throw kaitai::validation_less_than_error(std::string("\x50", 1), foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= std::string("\x50", 1))) { + throw kaitai::validation_less_than_error(std::string("\x50", 1), m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= std::string("\x50\x31", 2))) { - throw kaitai::validation_greater_than_error(std::string("\x50\x31", 2), foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= std::string("\x50\x31", 2))) { + throw kaitai::validation_greater_than_error(std::string("\x50\x31", 2), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_range_float.cpp b/compiled/cpp_stl_98/valid_fail_range_float.cpp index d3fdae1e0..d447f5b83 100644 --- a/compiled/cpp_stl_98/valid_fail_range_float.cpp +++ b/compiled/cpp_stl_98/valid_fail_range_float.cpp @@ -17,11 +17,11 @@ valid_fail_range_float_t::valid_fail_range_float_t(kaitai::kstream* p__io, kaita void valid_fail_range_float_t::_read() { m_foo = m__io->read_f4le(); - if (!(foo() >= 0.2)) { - throw kaitai::validation_less_than_error(0.2, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 0.2)) { + throw kaitai::validation_less_than_error(0.2, m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= 0.4)) { - throw kaitai::validation_greater_than_error(0.4, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 0.4)) { + throw kaitai::validation_greater_than_error(0.4, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_range_int.cpp b/compiled/cpp_stl_98/valid_fail_range_int.cpp index b72dd6bc1..8d420d313 100644 --- a/compiled/cpp_stl_98/valid_fail_range_int.cpp +++ b/compiled/cpp_stl_98/valid_fail_range_int.cpp @@ -17,11 +17,11 @@ valid_fail_range_int_t::valid_fail_range_int_t(kaitai::kstream* p__io, kaitai::k void valid_fail_range_int_t::_read() { m_foo = m__io->read_u1(); - if (!(foo() >= 5)) { - throw kaitai::validation_less_than_error(5, foo(), _io(), std::string("/seq/0")); + if (!(m_foo >= 5)) { + throw kaitai::validation_less_than_error(5, m_foo, m__io, std::string("/seq/0")); } - if (!(foo() <= 10)) { - throw kaitai::validation_greater_than_error(10, foo(), _io(), std::string("/seq/0")); + if (!(m_foo <= 10)) { + throw kaitai::validation_greater_than_error(10, m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_range_str.cpp b/compiled/cpp_stl_98/valid_fail_range_str.cpp index 9a55991b8..b5e567bcb 100644 --- a/compiled/cpp_stl_98/valid_fail_range_str.cpp +++ b/compiled/cpp_stl_98/valid_fail_range_str.cpp @@ -17,11 +17,11 @@ valid_fail_range_str_t::valid_fail_range_str_t(kaitai::kstream* p__io, kaitai::k void valid_fail_range_str_t::_read() { m_foo = kaitai::kstream::bytes_to_str(m__io->read_bytes(2), "ASCII"); - if (!((foo().compare(std::string("P")) >= 0))) { - throw kaitai::validation_less_than_error(std::string("P"), foo(), _io(), std::string("/seq/0")); + if (!((m_foo.compare(std::string("P")) >= 0))) { + throw kaitai::validation_less_than_error(std::string("P"), m_foo, m__io, std::string("/seq/0")); } - if (!((foo().compare(std::string("P1")) <= 0))) { - throw kaitai::validation_greater_than_error(std::string("P1"), foo(), _io(), std::string("/seq/0")); + if (!((m_foo.compare(std::string("P1")) <= 0))) { + throw kaitai::validation_greater_than_error(std::string("P1"), m_foo, m__io, std::string("/seq/0")); } } diff --git a/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.cpp b/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.cpp new file mode 100644 index 000000000..fecea0814 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.cpp @@ -0,0 +1,41 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_anyof_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_anyof_int_t::valid_fail_repeat_anyof_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_anyof_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_anyof_int_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_u1()); + if (!( ((m_foo->at(i) == 0) || (m_foo->at(i) == 1) || (m_foo->at(i) == 65)) )) { + throw kaitai::validation_not_any_of_error(m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_anyof_int_t::~valid_fail_repeat_anyof_int_t() { + _clean_up(); +} + +void valid_fail_repeat_anyof_int_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.h b/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.h new file mode 100644 index 000000000..60f0573ce --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_anyof_int.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_ANYOF_INT_H_ +#define VALID_FAIL_REPEAT_ANYOF_INT_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_anyof_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_anyof_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_anyof_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_anyof_int_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_anyof_int_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_anyof_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_anyof_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_ANYOF_INT_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_contents.cpp b/compiled/cpp_stl_98/valid_fail_repeat_contents.cpp new file mode 100644 index 000000000..dd00251a7 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_contents.cpp @@ -0,0 +1,41 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_contents.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_contents_t::valid_fail_repeat_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_contents_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_contents_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_bytes(4)); + if (!(m_foo->at(i) == std::string("\x12\x34\x56\x78", 4))) { + throw kaitai::validation_not_equal_error(std::string("\x12\x34\x56\x78", 4), m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_contents_t::~valid_fail_repeat_contents_t() { + _clean_up(); +} + +void valid_fail_repeat_contents_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_contents.h b/compiled/cpp_stl_98/valid_fail_repeat_contents.h new file mode 100644 index 000000000..953a97fdc --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_contents.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_CONTENTS_H_ +#define VALID_FAIL_REPEAT_CONTENTS_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_contents_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_contents_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_contents_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_contents_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_contents_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_contents_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_contents_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_CONTENTS_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_eq_int.cpp b/compiled/cpp_stl_98/valid_fail_repeat_eq_int.cpp new file mode 100644 index 000000000..db20c28b9 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_eq_int.cpp @@ -0,0 +1,41 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_eq_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_eq_int_t::valid_fail_repeat_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_eq_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_eq_int_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_u4be()); + if (!(m_foo->at(i) == 305419896)) { + throw kaitai::validation_not_equal_error(305419896, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_eq_int_t::~valid_fail_repeat_eq_int_t() { + _clean_up(); +} + +void valid_fail_repeat_eq_int_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_eq_int.h b/compiled/cpp_stl_98/valid_fail_repeat_eq_int.h new file mode 100644 index 000000000..219cf9e76 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_eq_int.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_EQ_INT_H_ +#define VALID_FAIL_REPEAT_EQ_INT_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_eq_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_eq_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_eq_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_eq_int_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_eq_int_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_eq_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_eq_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_EQ_INT_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_expr.cpp b/compiled/cpp_stl_98/valid_fail_repeat_expr.cpp new file mode 100644 index 000000000..b5ac8cbe8 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_expr.cpp @@ -0,0 +1,44 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_expr.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_expr_t::valid_fail_repeat_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_expr_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_expr_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_bytes(4)); + { + std::string _ = m_foo->at(i); + if (!(_ != std::string("\x00\x12\x34\x56", 4))) { + throw kaitai::validation_expr_error(m_foo->at(i), m__io, std::string("/seq/0")); + } + } + i++; + } + } +} + +valid_fail_repeat_expr_t::~valid_fail_repeat_expr_t() { + _clean_up(); +} + +void valid_fail_repeat_expr_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_expr.h b/compiled/cpp_stl_98/valid_fail_repeat_expr.h new file mode 100644 index 000000000..8d19713d4 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_expr.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_EXPR_H_ +#define VALID_FAIL_REPEAT_EXPR_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_expr_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_expr_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_expr_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_expr_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_expr_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_expr_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_expr_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_EXPR_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_inst.cpp b/compiled/cpp_stl_98/valid_fail_repeat_inst.cpp new file mode 100644 index 000000000..4ed9348ec --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_inst.cpp @@ -0,0 +1,61 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_inst.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_inst_t::valid_fail_repeat_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_inst_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_inst = 0; + f_inst = false; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_inst_t::_read() { + n_a = true; + if (inst()->size() == 0) { + n_a = false; + m_a = m__io->read_bytes(0); + } +} + +valid_fail_repeat_inst_t::~valid_fail_repeat_inst_t() { + _clean_up(); +} + +void valid_fail_repeat_inst_t::_clean_up() { + if (!n_a) { + } + if (f_inst) { + if (m_inst) { + delete m_inst; m_inst = 0; + } + } +} + +std::vector* valid_fail_repeat_inst_t::inst() { + if (f_inst) + return m_inst; + std::streampos _pos = m__io->pos(); + m__io->seek(0); + m_inst = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_inst->push_back(m__io->read_u4be()); + if (!(m_inst->at(i) == 305419896)) { + throw kaitai::validation_not_equal_error(305419896, m_inst->at(i), m__io, std::string("/instances/inst")); + } + i++; + } + } + m__io->seek(_pos); + f_inst = true; + return m_inst; +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_inst.h b/compiled/cpp_stl_98/valid_fail_repeat_inst.h new file mode 100644 index 000000000..6208dfde8 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_inst.h @@ -0,0 +1,53 @@ +#ifndef VALID_FAIL_REPEAT_INST_H_ +#define VALID_FAIL_REPEAT_INST_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_inst_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_inst_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_inst_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_inst_t(); + +private: + bool f_inst; + std::vector* m_inst; + +public: + std::vector* inst(); + +private: + std::string m_a; + bool n_a; + +public: + bool _is_null_a() { a(); return n_a; }; + +private: + valid_fail_repeat_inst_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::string a() const { return m_a; } + valid_fail_repeat_inst_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_INST_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_max_int.cpp b/compiled/cpp_stl_98/valid_fail_repeat_max_int.cpp new file mode 100644 index 000000000..688365a72 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_max_int.cpp @@ -0,0 +1,41 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_max_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_max_int_t::valid_fail_repeat_max_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_max_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_max_int_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_u1()); + if (!(m_foo->at(i) <= 254)) { + throw kaitai::validation_greater_than_error(254, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_max_int_t::~valid_fail_repeat_max_int_t() { + _clean_up(); +} + +void valid_fail_repeat_max_int_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_max_int.h b/compiled/cpp_stl_98/valid_fail_repeat_max_int.h new file mode 100644 index 000000000..da9b12a80 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_max_int.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_MAX_INT_H_ +#define VALID_FAIL_REPEAT_MAX_INT_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_max_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_max_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_max_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_max_int_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_max_int_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_max_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_max_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_MAX_INT_H_ diff --git a/compiled/cpp_stl_98/valid_fail_repeat_min_int.cpp b/compiled/cpp_stl_98/valid_fail_repeat_min_int.cpp new file mode 100644 index 000000000..ab813d436 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_min_int.cpp @@ -0,0 +1,41 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +#include "valid_fail_repeat_min_int.h" +#include "kaitai/exceptions.h" + +valid_fail_repeat_min_int_t::valid_fail_repeat_min_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, valid_fail_repeat_min_int_t* p__root) : kaitai::kstruct(p__io) { + m__parent = p__parent; + m__root = p__root ? p__root : this; + m_foo = 0; + + try { + _read(); + } catch(...) { + _clean_up(); + throw; + } +} + +void valid_fail_repeat_min_int_t::_read() { + m_foo = new std::vector(); + { + int i = 0; + while (!m__io->is_eof()) { + m_foo->push_back(m__io->read_s1()); + if (!(m_foo->at(i) >= 0)) { + throw kaitai::validation_less_than_error(0, m_foo->at(i), m__io, std::string("/seq/0")); + } + i++; + } + } +} + +valid_fail_repeat_min_int_t::~valid_fail_repeat_min_int_t() { + _clean_up(); +} + +void valid_fail_repeat_min_int_t::_clean_up() { + if (m_foo) { + delete m_foo; m_foo = 0; + } +} diff --git a/compiled/cpp_stl_98/valid_fail_repeat_min_int.h b/compiled/cpp_stl_98/valid_fail_repeat_min_int.h new file mode 100644 index 000000000..d06780a28 --- /dev/null +++ b/compiled/cpp_stl_98/valid_fail_repeat_min_int.h @@ -0,0 +1,40 @@ +#ifndef VALID_FAIL_REPEAT_MIN_INT_H_ +#define VALID_FAIL_REPEAT_MIN_INT_H_ + +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +class valid_fail_repeat_min_int_t; + +#include "kaitai/kaitaistruct.h" +#include +#include + +#if KAITAI_STRUCT_VERSION < 11000L +#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required" +#endif + +class valid_fail_repeat_min_int_t : public kaitai::kstruct { + +public: + + valid_fail_repeat_min_int_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, valid_fail_repeat_min_int_t* p__root = 0); + +private: + void _read(); + void _clean_up(); + +public: + ~valid_fail_repeat_min_int_t(); + +private: + std::vector* m_foo; + valid_fail_repeat_min_int_t* m__root; + kaitai::kstruct* m__parent; + +public: + std::vector* foo() const { return m_foo; } + valid_fail_repeat_min_int_t* _root() const { return m__root; } + kaitai::kstruct* _parent() const { return m__parent; } +}; + +#endif // VALID_FAIL_REPEAT_MIN_INT_H_ diff --git a/compiled/cpp_stl_98/valid_long.cpp b/compiled/cpp_stl_98/valid_long.cpp index 2484e3865..321652307 100644 --- a/compiled/cpp_stl_98/valid_long.cpp +++ b/compiled/cpp_stl_98/valid_long.cpp @@ -17,48 +17,48 @@ valid_long_t::valid_long_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, v void valid_long_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); - if (!(uint8() == 255)) { - throw kaitai::validation_not_equal_error(255, uint8(), _io(), std::string("/seq/1")); + if (!(m_uint8 == 255)) { + throw kaitai::validation_not_equal_error(255, m_uint8, m__io, std::string("/seq/1")); } m_sint8 = m__io->read_s1(); - if (!(sint8() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint8(), _io(), std::string("/seq/2")); + if (!(m_sint8 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint8, m__io, std::string("/seq/2")); } m_magic_uint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_uint() == (std::string("PACK-U-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == (std::string("PACK-U-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); - if (!(uint16() == 65535)) { - throw kaitai::validation_not_equal_error(65535, uint16(), _io(), std::string("/seq/4")); + if (!(m_uint16 == 65535)) { + throw kaitai::validation_not_equal_error(65535, m_uint16, m__io, std::string("/seq/4")); } m_uint32 = m__io->read_u4le(); - if (!(uint32() == 4294967295UL)) { - throw kaitai::validation_not_equal_error(4294967295UL, uint32(), _io(), std::string("/seq/5")); + if (!(m_uint32 == 4294967295UL)) { + throw kaitai::validation_not_equal_error(4294967295UL, m_uint32, m__io, std::string("/seq/5")); } m_uint64 = m__io->read_u8le(); - if (!(uint64() == 18446744073709551615ULL)) { - throw kaitai::validation_not_equal_error(18446744073709551615ULL, uint64(), _io(), std::string("/seq/6")); + if (!(m_uint64 == 18446744073709551615ULL)) { + throw kaitai::validation_not_equal_error(18446744073709551615ULL, m_uint64, m__io, std::string("/seq/6")); } m_magic_sint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_sint() == (std::string("PACK-S-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == (std::string("PACK-S-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); - if (!(sint16() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint16(), _io(), std::string("/seq/8")); + if (!(m_sint16 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint16, m__io, std::string("/seq/8")); } m_sint32 = m__io->read_s4le(); - if (!(sint32() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint32(), _io(), std::string("/seq/9")); + if (!(m_sint32 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint32, m__io, std::string("/seq/9")); } m_sint64 = m__io->read_s8le(); - if (!(sint64() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint64(), _io(), std::string("/seq/10")); + if (!(m_sint64 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint64, m__io, std::string("/seq/10")); } } diff --git a/compiled/cpp_stl_98/valid_not_parsed_if.cpp b/compiled/cpp_stl_98/valid_not_parsed_if.cpp index dab2ee16e..0f0593a5f 100644 --- a/compiled/cpp_stl_98/valid_not_parsed_if.cpp +++ b/compiled/cpp_stl_98/valid_not_parsed_if.cpp @@ -20,16 +20,16 @@ void valid_not_parsed_if_t::_read() { if (false) { n_not_parsed = false; m_not_parsed = m__io->read_u1(); - if (!(not_parsed() == 42)) { - throw kaitai::validation_not_equal_error(42, not_parsed(), _io(), std::string("/seq/0")); + if (!(m_not_parsed == 42)) { + throw kaitai::validation_not_equal_error(42, m_not_parsed, m__io, std::string("/seq/0")); } } n_parsed = true; if (true) { n_parsed = false; m_parsed = m__io->read_u1(); - if (!(parsed() == 80)) { - throw kaitai::validation_not_equal_error(80, parsed(), _io(), std::string("/seq/1")); + if (!(m_parsed == 80)) { + throw kaitai::validation_not_equal_error(80, m_parsed, m__io, std::string("/seq/1")); } } } diff --git a/compiled/cpp_stl_98/valid_optional_id.cpp b/compiled/cpp_stl_98/valid_optional_id.cpp index c7a0a748e..45204a24a 100644 --- a/compiled/cpp_stl_98/valid_optional_id.cpp +++ b/compiled/cpp_stl_98/valid_optional_id.cpp @@ -17,18 +17,18 @@ valid_optional_id_t::valid_optional_id_t(kaitai::kstream* p__io, kaitai::kstruct void valid_optional_id_t::_read() { m__unnamed0 = m__io->read_bytes(6); - if (!(_unnamed0() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), _unnamed0(), _io(), std::string("/seq/0")); + if (!(m__unnamed0 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m__unnamed0, m__io, std::string("/seq/0")); } m__unnamed1 = m__io->read_u1(); - if (!(_unnamed1() == 255)) { - throw kaitai::validation_not_equal_error(255, _unnamed1(), _io(), std::string("/seq/1")); + if (!(m__unnamed1 == 255)) { + throw kaitai::validation_not_equal_error(255, m__unnamed1, m__io, std::string("/seq/1")); } m__unnamed2 = m__io->read_s1(); { - int8_t _ = _unnamed2(); + int8_t _ = m__unnamed2; if (!(_ == -1)) { - throw kaitai::validation_expr_error(_unnamed2(), _io(), std::string("/seq/2")); + throw kaitai::validation_expr_error(m__unnamed2, m__io, std::string("/seq/2")); } } } diff --git a/compiled/cpp_stl_98/valid_short.cpp b/compiled/cpp_stl_98/valid_short.cpp index fda6ba9c1..ba42f4804 100644 --- a/compiled/cpp_stl_98/valid_short.cpp +++ b/compiled/cpp_stl_98/valid_short.cpp @@ -17,48 +17,48 @@ valid_short_t::valid_short_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, void valid_short_t::_read() { m_magic1 = m__io->read_bytes(6); - if (!(magic1() == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { - throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), magic1(), _io(), std::string("/seq/0")); + if (!(m_magic1 == std::string("\x50\x41\x43\x4B\x2D\x31", 6))) { + throw kaitai::validation_not_equal_error(std::string("\x50\x41\x43\x4B\x2D\x31", 6), m_magic1, m__io, std::string("/seq/0")); } m_uint8 = m__io->read_u1(); - if (!(uint8() == 255)) { - throw kaitai::validation_not_equal_error(255, uint8(), _io(), std::string("/seq/1")); + if (!(m_uint8 == 255)) { + throw kaitai::validation_not_equal_error(255, m_uint8, m__io, std::string("/seq/1")); } m_sint8 = m__io->read_s1(); - if (!(sint8() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint8(), _io(), std::string("/seq/2")); + if (!(m_sint8 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint8, m__io, std::string("/seq/2")); } m_magic_uint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_uint() == (std::string("PACK-U-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), magic_uint(), _io(), std::string("/seq/3")); + if (!(m_magic_uint == (std::string("PACK-U-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-U-DEF"), m_magic_uint, m__io, std::string("/seq/3")); } m_uint16 = m__io->read_u2le(); - if (!(uint16() == 65535)) { - throw kaitai::validation_not_equal_error(65535, uint16(), _io(), std::string("/seq/4")); + if (!(m_uint16 == 65535)) { + throw kaitai::validation_not_equal_error(65535, m_uint16, m__io, std::string("/seq/4")); } m_uint32 = m__io->read_u4le(); - if (!(uint32() == 4294967295UL)) { - throw kaitai::validation_not_equal_error(4294967295UL, uint32(), _io(), std::string("/seq/5")); + if (!(m_uint32 == 4294967295UL)) { + throw kaitai::validation_not_equal_error(4294967295UL, m_uint32, m__io, std::string("/seq/5")); } m_uint64 = m__io->read_u8le(); - if (!(uint64() == 18446744073709551615ULL)) { - throw kaitai::validation_not_equal_error(18446744073709551615ULL, uint64(), _io(), std::string("/seq/6")); + if (!(m_uint64 == 18446744073709551615ULL)) { + throw kaitai::validation_not_equal_error(18446744073709551615ULL, m_uint64, m__io, std::string("/seq/6")); } m_magic_sint = kaitai::kstream::bytes_to_str(m__io->read_bytes(10), "UTF-8"); - if (!(magic_sint() == (std::string("PACK-S-DEF")))) { - throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), magic_sint(), _io(), std::string("/seq/7")); + if (!(m_magic_sint == (std::string("PACK-S-DEF")))) { + throw kaitai::validation_not_equal_error(std::string("PACK-S-DEF"), m_magic_sint, m__io, std::string("/seq/7")); } m_sint16 = m__io->read_s2le(); - if (!(sint16() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint16(), _io(), std::string("/seq/8")); + if (!(m_sint16 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint16, m__io, std::string("/seq/8")); } m_sint32 = m__io->read_s4le(); - if (!(sint32() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint32(), _io(), std::string("/seq/9")); + if (!(m_sint32 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint32, m__io, std::string("/seq/9")); } m_sint64 = m__io->read_s8le(); - if (!(sint64() == -1)) { - throw kaitai::validation_not_equal_error(-1, sint64(), _io(), std::string("/seq/10")); + if (!(m_sint64 == -1)) { + throw kaitai::validation_not_equal_error(-1, m_sint64, m__io, std::string("/seq/10")); } } diff --git a/compiled/cpp_stl_98/valid_switch.cpp b/compiled/cpp_stl_98/valid_switch.cpp index 00112b5ee..cf121b248 100644 --- a/compiled/cpp_stl_98/valid_switch.cpp +++ b/compiled/cpp_stl_98/valid_switch.cpp @@ -17,8 +17,8 @@ valid_switch_t::valid_switch_t(kaitai::kstream* p__io, kaitai::kstruct* p__paren void valid_switch_t::_read() { m_a = m__io->read_u1(); - if (!(a() == 80)) { - throw kaitai::validation_not_equal_error(80, a(), _io(), std::string("/seq/0")); + if (!(m_a == 80)) { + throw kaitai::validation_not_equal_error(80, m_a, m__io, std::string("/seq/0")); } switch (a()) { case 80: { @@ -30,8 +30,8 @@ void valid_switch_t::_read() { break; } } - if (!(b() == 17217)) { - throw kaitai::validation_not_equal_error(17217, b(), _io(), std::string("/seq/1")); + if (!(m_b == 17217)) { + throw kaitai::validation_not_equal_error(17217, m_b, m__io, std::string("/seq/1")); } } diff --git a/compiled/csharp/FixedContents.cs b/compiled/csharp/FixedContents.cs index e9c8bc1fe..c2c393037 100644 --- a/compiled/csharp/FixedContents.cs +++ b/compiled/csharp/FixedContents.cs @@ -20,14 +20,14 @@ public FixedContents(KaitaiStream p__io, KaitaiStruct p__parent = null, FixedCon private void _read() { _normal = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Normal, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_normal, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Normal, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _normal, m_io, "/seq/0"); } _highBit8 = m_io.ReadBytes(2); - if (!((KaitaiStream.ByteArrayCompare(HighBit8, new byte[] { 255, 255 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_highBit8, new byte[] { 255, 255 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 255, 255 }, HighBit8, M_Io, "/seq/1"); + throw new ValidationNotEqualError(new byte[] { 255, 255 }, _highBit8, m_io, "/seq/1"); } } private byte[] _normal; diff --git a/compiled/csharp/FixedStruct.cs b/compiled/csharp/FixedStruct.cs index c35789f40..adc3a49bc 100644 --- a/compiled/csharp/FixedStruct.cs +++ b/compiled/csharp/FixedStruct.cs @@ -37,56 +37,56 @@ public Header(KaitaiStream p__io, FixedStruct p__parent = null, FixedStruct p__r private void _read() { _magic1 = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/types/header/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _magic1, m_io, "/types/header/seq/0"); } _uint8 = m_io.ReadU1(); _sint8 = m_io.ReadS1(); _magicUint = m_io.ReadBytes(10); - if (!((KaitaiStream.ByteArrayCompare(MagicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, MagicUint, M_Io, "/types/header/seq/3"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, _magicUint, m_io, "/types/header/seq/3"); } _uint16 = m_io.ReadU2le(); _uint32 = m_io.ReadU4le(); _uint64 = m_io.ReadU8le(); _magicSint = m_io.ReadBytes(10); - if (!((KaitaiStream.ByteArrayCompare(MagicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, MagicSint, M_Io, "/types/header/seq/7"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, _magicSint, m_io, "/types/header/seq/7"); } _sint16 = m_io.ReadS2le(); _sint32 = m_io.ReadS4le(); _sint64 = m_io.ReadS8le(); _magicUintLe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, MagicUintLe, M_Io, "/types/header/seq/11"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, _magicUintLe, m_io, "/types/header/seq/11"); } _uint16le = m_io.ReadU2le(); _uint32le = m_io.ReadU4le(); _uint64le = m_io.ReadU8le(); _magicSintLe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, MagicSintLe, M_Io, "/types/header/seq/15"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, _magicSintLe, m_io, "/types/header/seq/15"); } _sint16le = m_io.ReadS2le(); _sint32le = m_io.ReadS4le(); _sint64le = m_io.ReadS8le(); _magicUintBe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, MagicUintBe, M_Io, "/types/header/seq/19"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, _magicUintBe, m_io, "/types/header/seq/19"); } _uint16be = m_io.ReadU2be(); _uint32be = m_io.ReadU4be(); _uint64be = m_io.ReadU8be(); _magicSintBe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, MagicSintBe, M_Io, "/types/header/seq/23"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, _magicSintBe, m_io, "/types/header/seq/23"); } _sint16be = m_io.ReadS2be(); _sint32be = m_io.ReadS4be(); diff --git a/compiled/csharp/Integers.cs b/compiled/csharp/Integers.cs index a031ff9fe..04b719472 100644 --- a/compiled/csharp/Integers.cs +++ b/compiled/csharp/Integers.cs @@ -20,56 +20,56 @@ public Integers(KaitaiStream p__io, KaitaiStruct p__parent = null, Integers p__r private void _read() { _magic1 = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _magic1, m_io, "/seq/0"); } _uint8 = m_io.ReadU1(); _sint8 = m_io.ReadS1(); _magicUint = m_io.ReadBytes(10); - if (!((KaitaiStream.ByteArrayCompare(MagicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, MagicUint, M_Io, "/seq/3"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, _magicUint, m_io, "/seq/3"); } _uint16 = m_io.ReadU2le(); _uint32 = m_io.ReadU4le(); _uint64 = m_io.ReadU8le(); _magicSint = m_io.ReadBytes(10); - if (!((KaitaiStream.ByteArrayCompare(MagicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, MagicSint, M_Io, "/seq/7"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, _magicSint, m_io, "/seq/7"); } _sint16 = m_io.ReadS2le(); _sint32 = m_io.ReadS4le(); _sint64 = m_io.ReadS8le(); _magicUintLe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, MagicUintLe, M_Io, "/seq/11"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, _magicUintLe, m_io, "/seq/11"); } _uint16le = m_io.ReadU2le(); _uint32le = m_io.ReadU4le(); _uint64le = m_io.ReadU8le(); _magicSintLe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, MagicSintLe, M_Io, "/seq/15"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, _magicSintLe, m_io, "/seq/15"); } _sint16le = m_io.ReadS2le(); _sint32le = m_io.ReadS4le(); _sint64le = m_io.ReadS8le(); _magicUintBe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, MagicUintBe, M_Io, "/seq/19"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, _magicUintBe, m_io, "/seq/19"); } _uint16be = m_io.ReadU2be(); _uint32be = m_io.ReadU4be(); _uint64be = m_io.ReadU8be(); _magicSintBe = m_io.ReadBytes(9); - if (!((KaitaiStream.ByteArrayCompare(MagicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, MagicSintBe, M_Io, "/seq/23"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, _magicSintBe, m_io, "/seq/23"); } _sint16be = m_io.ReadS2be(); _sint32be = m_io.ReadS4be(); diff --git a/compiled/csharp/StrPadTermUtf16.cs b/compiled/csharp/StrPadTermUtf16.cs new file mode 100644 index 000000000..6e6b44f95 --- /dev/null +++ b/compiled/csharp/StrPadTermUtf16.cs @@ -0,0 +1,37 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + + + +namespace Kaitai +{ + public partial class StrPadTermUtf16 : KaitaiStruct + { + public static StrPadTermUtf16 FromFile(string fileName) + { + return new StrPadTermUtf16(new KaitaiStream(fileName)); + } + + public StrPadTermUtf16(KaitaiStream p__io, KaitaiStruct p__parent = null, StrPadTermUtf16 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _strTerm = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(KaitaiStream.BytesTerminateMulti(m_io.ReadBytes(10), new byte[] { 0, 0 }, false)); + _strTermInclude = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(KaitaiStream.BytesTerminateMulti(m_io.ReadBytes(10), new byte[] { 0, 0 }, true)); + _strTermAndPad = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(KaitaiStream.BytesTerminateMulti(KaitaiStream.BytesStripRight(m_io.ReadBytes(9), 43), new byte[] { 0, 0 }, false)); + } + private string _strTerm; + private string _strTermInclude; + private string _strTermAndPad; + private StrPadTermUtf16 m_root; + private KaitaiStruct m_parent; + public string StrTerm { get { return _strTerm; } } + public string StrTermInclude { get { return _strTermInclude; } } + public string StrTermAndPad { get { return _strTermAndPad; } } + public StrPadTermUtf16 M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/TermStrzUtf16V1.cs b/compiled/csharp/TermStrzUtf16V1.cs new file mode 100644 index 000000000..1bef8c7c9 --- /dev/null +++ b/compiled/csharp/TermStrzUtf16V1.cs @@ -0,0 +1,40 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + + + +namespace Kaitai +{ + public partial class TermStrzUtf16V1 : KaitaiStruct + { + public static TermStrzUtf16V1 FromFile(string fileName) + { + return new TermStrzUtf16V1(new KaitaiStream(fileName)); + } + + public TermStrzUtf16V1(KaitaiStream p__io, KaitaiStruct p__parent = null, TermStrzUtf16V1 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _s1 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, true, true)); + _s2 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, false, true)); + _term = m_io.ReadU2le(); + _s3 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, true, true, true)); + } + private string _s1; + private string _s2; + private ushort _term; + private string _s3; + private TermStrzUtf16V1 m_root; + private KaitaiStruct m_parent; + public string S1 { get { return _s1; } } + public string S2 { get { return _s2; } } + public ushort Term { get { return _term; } } + public string S3 { get { return _s3; } } + public TermStrzUtf16V1 M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/TermStrzUtf16V2.cs b/compiled/csharp/TermStrzUtf16V2.cs new file mode 100644 index 000000000..c8ed8f5d9 --- /dev/null +++ b/compiled/csharp/TermStrzUtf16V2.cs @@ -0,0 +1,37 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + + + +namespace Kaitai +{ + public partial class TermStrzUtf16V2 : KaitaiStruct + { + public static TermStrzUtf16V2 FromFile(string fileName) + { + return new TermStrzUtf16V2(new KaitaiStream(fileName)); + } + + public TermStrzUtf16V2(KaitaiStream p__io, KaitaiStruct p__parent = null, TermStrzUtf16V2 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _s1 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, true, true)); + _s2 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, true, true, true)); + _s3 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, false, true)); + } + private string _s1; + private string _s2; + private string _s3; + private TermStrzUtf16V2 m_root; + private KaitaiStruct m_parent; + public string S1 { get { return _s1; } } + public string S2 { get { return _s2; } } + public string S3 { get { return _s3; } } + public TermStrzUtf16V2 M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/TermStrzUtf16V3.cs b/compiled/csharp/TermStrzUtf16V3.cs new file mode 100644 index 000000000..d5d46d1ea --- /dev/null +++ b/compiled/csharp/TermStrzUtf16V3.cs @@ -0,0 +1,40 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + + + +namespace Kaitai +{ + public partial class TermStrzUtf16V3 : KaitaiStruct + { + public static TermStrzUtf16V3 FromFile(string fileName) + { + return new TermStrzUtf16V3(new KaitaiStream(fileName)); + } + + public TermStrzUtf16V3(KaitaiStream p__io, KaitaiStruct p__parent = null, TermStrzUtf16V3 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _s1 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, false, true)); + _term = m_io.ReadU2le(); + _s2 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, false, true)); + _s3 = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, true, true)); + } + private string _s1; + private ushort _term; + private string _s2; + private string _s3; + private TermStrzUtf16V3 m_root; + private KaitaiStruct m_parent; + public string S1 { get { return _s1; } } + public ushort Term { get { return _term; } } + public string S2 { get { return _s2; } } + public string S3 { get { return _s3; } } + public TermStrzUtf16V3 M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/TermStrzUtf16V4.cs b/compiled/csharp/TermStrzUtf16V4.cs new file mode 100644 index 000000000..98e1b2e4c --- /dev/null +++ b/compiled/csharp/TermStrzUtf16V4.cs @@ -0,0 +1,127 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + + + +namespace Kaitai +{ + public partial class TermStrzUtf16V4 : KaitaiStruct + { + public static TermStrzUtf16V4 FromFile(string fileName) + { + return new TermStrzUtf16V4(new KaitaiStream(fileName)); + } + + public TermStrzUtf16V4(KaitaiStream p__io, KaitaiStruct p__parent = null, TermStrzUtf16V4 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + __raw_s1 = m_io.ReadBytes(6); + var io___raw_s1 = new KaitaiStream(__raw_s1); + _s1 = new S1Type(io___raw_s1, this, m_root); + _skipTerm1 = m_io.ReadBytes(2); + __raw_s2 = m_io.ReadBytes(6); + var io___raw_s2 = new KaitaiStream(__raw_s2); + _s2 = new S2Type(io___raw_s2, this, m_root); + _skipTerm2 = m_io.ReadBytes(2); + __raw_s3 = m_io.ReadBytes(6); + var io___raw_s3 = new KaitaiStream(__raw_s3); + _s3 = new S3Type(io___raw_s3, this, m_root); + } + public partial class S1Type : KaitaiStruct + { + public static S1Type FromFile(string fileName) + { + return new S1Type(new KaitaiStream(fileName)); + } + + public S1Type(KaitaiStream p__io, TermStrzUtf16V4 p__parent = null, TermStrzUtf16V4 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root; + _read(); + } + private void _read() + { + _value = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, true, false)); + } + private string _value; + private TermStrzUtf16V4 m_root; + private TermStrzUtf16V4 m_parent; + public string Value { get { return _value; } } + public TermStrzUtf16V4 M_Root { get { return m_root; } } + public TermStrzUtf16V4 M_Parent { get { return m_parent; } } + } + public partial class S2Type : KaitaiStruct + { + public static S2Type FromFile(string fileName) + { + return new S2Type(new KaitaiStream(fileName)); + } + + public S2Type(KaitaiStream p__io, TermStrzUtf16V4 p__parent = null, TermStrzUtf16V4 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root; + _read(); + } + private void _read() + { + _value = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, false, false, false)); + } + private string _value; + private TermStrzUtf16V4 m_root; + private TermStrzUtf16V4 m_parent; + public string Value { get { return _value; } } + public TermStrzUtf16V4 M_Root { get { return m_root; } } + public TermStrzUtf16V4 M_Parent { get { return m_parent; } } + } + public partial class S3Type : KaitaiStruct + { + public static S3Type FromFile(string fileName) + { + return new S3Type(new KaitaiStream(fileName)); + } + + public S3Type(KaitaiStream p__io, TermStrzUtf16V4 p__parent = null, TermStrzUtf16V4 p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root; + _read(); + } + private void _read() + { + _value = System.Text.Encoding.GetEncoding("UTF-16LE").GetString(m_io.ReadBytesTermMulti(new byte[] { 0, 0 }, true, true, false)); + } + private string _value; + private TermStrzUtf16V4 m_root; + private TermStrzUtf16V4 m_parent; + public string Value { get { return _value; } } + public TermStrzUtf16V4 M_Root { get { return m_root; } } + public TermStrzUtf16V4 M_Parent { get { return m_parent; } } + } + private S1Type _s1; + private byte[] _skipTerm1; + private S2Type _s2; + private byte[] _skipTerm2; + private S3Type _s3; + private TermStrzUtf16V4 m_root; + private KaitaiStruct m_parent; + private byte[] __raw_s1; + private byte[] __raw_s2; + private byte[] __raw_s3; + public S1Type S1 { get { return _s1; } } + public byte[] SkipTerm1 { get { return _skipTerm1; } } + public S2Type S2 { get { return _s2; } } + public byte[] SkipTerm2 { get { return _skipTerm2; } } + public S3Type S3 { get { return _s3; } } + public TermStrzUtf16V4 M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + public byte[] M_RawS1 { get { return __raw_s1; } } + public byte[] M_RawS2 { get { return __raw_s2; } } + public byte[] M_RawS3 { get { return __raw_s3; } } + } +} diff --git a/compiled/csharp/ValidEqStrEncodings.cs b/compiled/csharp/ValidEqStrEncodings.cs index ef4146f0f..0a655e6d6 100644 --- a/compiled/csharp/ValidEqStrEncodings.cs +++ b/compiled/csharp/ValidEqStrEncodings.cs @@ -21,27 +21,27 @@ private void _read() { _lenOf1 = m_io.ReadU2le(); _str1 = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(LenOf1)); - if (!(Str1 == "Some ASCII")) + if (!(_str1 == "Some ASCII")) { - throw new ValidationNotEqualError("Some ASCII", Str1, M_Io, "/seq/1"); + throw new ValidationNotEqualError("Some ASCII", _str1, m_io, "/seq/1"); } _lenOf2 = m_io.ReadU2le(); _str2 = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(LenOf2)); - if (!(Str2 == "\u3053\u3093\u306b\u3061\u306f")) + if (!(_str2 == "\u3053\u3093\u306b\u3061\u306f")) { - throw new ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", Str2, M_Io, "/seq/3"); + throw new ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", _str2, m_io, "/seq/3"); } _lenOf3 = m_io.ReadU2le(); _str3 = System.Text.Encoding.GetEncoding("SJIS").GetString(m_io.ReadBytes(LenOf3)); - if (!(Str3 == "\u3053\u3093\u306b\u3061\u306f")) + if (!(_str3 == "\u3053\u3093\u306b\u3061\u306f")) { - throw new ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", Str3, M_Io, "/seq/5"); + throw new ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", _str3, m_io, "/seq/5"); } _lenOf4 = m_io.ReadU2le(); _str4 = System.Text.Encoding.GetEncoding("IBM437").GetString(m_io.ReadBytes(LenOf4)); - if (!(Str4 == "\u2591\u2592\u2593")) + if (!(_str4 == "\u2591\u2592\u2593")) { - throw new ValidationNotEqualError("\u2591\u2592\u2593", Str4, M_Io, "/seq/7"); + throw new ValidationNotEqualError("\u2591\u2592\u2593", _str4, m_io, "/seq/7"); } } private ushort _lenOf1; diff --git a/compiled/csharp/ValidFailAnyofInt.cs b/compiled/csharp/ValidFailAnyofInt.cs index 4da22353a..a9e84d177 100644 --- a/compiled/csharp/ValidFailAnyofInt.cs +++ b/compiled/csharp/ValidFailAnyofInt.cs @@ -20,9 +20,9 @@ public ValidFailAnyofInt(KaitaiStream p__io, KaitaiStruct p__parent = null, Vali private void _read() { _foo = m_io.ReadU1(); - if (!( ((Foo == 5) || (Foo == 6) || (Foo == 7) || (Foo == 8) || (Foo == 10) || (Foo == 11) || (Foo == 12) || (Foo == 47)) )) + if (!( ((_foo == 5) || (_foo == 6) || (_foo == 7) || (_foo == 8) || (_foo == 10) || (_foo == 11) || (_foo == 12) || (_foo == 47)) )) { - throw new ValidationNotAnyOfError(Foo, M_Io, "/seq/0"); + throw new ValidationNotAnyOfError(_foo, m_io, "/seq/0"); } } private byte _foo; diff --git a/compiled/csharp/ValidFailContents.cs b/compiled/csharp/ValidFailContents.cs index e68719dd6..2924c3719 100644 --- a/compiled/csharp/ValidFailContents.cs +++ b/compiled/csharp/ValidFailContents.cs @@ -20,9 +20,9 @@ public ValidFailContents(KaitaiStream p__io, KaitaiStruct p__parent = null, Vali private void _read() { _foo = m_io.ReadBytes(2); - if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 81, 65 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_foo, new byte[] { 81, 65 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 81, 65 }, Foo, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 81, 65 }, _foo, m_io, "/seq/0"); } } private byte[] _foo; diff --git a/compiled/csharp/ValidFailEqBytes.cs b/compiled/csharp/ValidFailEqBytes.cs index 24d5eee87..c5dc5a54e 100644 --- a/compiled/csharp/ValidFailEqBytes.cs +++ b/compiled/csharp/ValidFailEqBytes.cs @@ -20,9 +20,9 @@ public ValidFailEqBytes(KaitaiStream p__io, KaitaiStruct p__parent = null, Valid private void _read() { _foo = m_io.ReadBytes(2); - if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 81, 65 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_foo, new byte[] { 81, 65 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 81, 65 }, Foo, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 81, 65 }, _foo, m_io, "/seq/0"); } } private byte[] _foo; diff --git a/compiled/csharp/ValidFailEqInt.cs b/compiled/csharp/ValidFailEqInt.cs index 7f0f592ef..fad5f6ae0 100644 --- a/compiled/csharp/ValidFailEqInt.cs +++ b/compiled/csharp/ValidFailEqInt.cs @@ -20,9 +20,9 @@ public ValidFailEqInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFa private void _read() { _foo = m_io.ReadU1(); - if (!(Foo == 123)) + if (!(_foo == 123)) { - throw new ValidationNotEqualError(123, Foo, M_Io, "/seq/0"); + throw new ValidationNotEqualError(123, _foo, m_io, "/seq/0"); } } private byte _foo; diff --git a/compiled/csharp/ValidFailEqStr.cs b/compiled/csharp/ValidFailEqStr.cs index a7c1a2937..ecbf72169 100644 --- a/compiled/csharp/ValidFailEqStr.cs +++ b/compiled/csharp/ValidFailEqStr.cs @@ -20,9 +20,9 @@ public ValidFailEqStr(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFa private void _read() { _foo = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(4)); - if (!(Foo == "BACK")) + if (!(_foo == "BACK")) { - throw new ValidationNotEqualError("BACK", Foo, M_Io, "/seq/0"); + throw new ValidationNotEqualError("BACK", _foo, m_io, "/seq/0"); } } private string _foo; diff --git a/compiled/csharp/ValidFailExpr.cs b/compiled/csharp/ValidFailExpr.cs index b26cd7e86..d7837e133 100644 --- a/compiled/csharp/ValidFailExpr.cs +++ b/compiled/csharp/ValidFailExpr.cs @@ -21,18 +21,18 @@ private void _read() { _foo = m_io.ReadU1(); { - byte M_ = Foo; + byte M_ = _foo; if (!(M_ == 1)) { - throw new ValidationExprError(Foo, M_Io, "/seq/0"); + throw new ValidationExprError(_foo, m_io, "/seq/0"); } } _bar = m_io.ReadS2le(); { - short M_ = Bar; + short M_ = _bar; if (!( ((M_ < -190) || (M_ > -190)) )) { - throw new ValidationExprError(Bar, M_Io, "/seq/1"); + throw new ValidationExprError(_bar, m_io, "/seq/1"); } } } diff --git a/compiled/csharp/ValidFailInst.cs b/compiled/csharp/ValidFailInst.cs index 5a9937bc3..f0574eaae 100644 --- a/compiled/csharp/ValidFailInst.cs +++ b/compiled/csharp/ValidFailInst.cs @@ -35,12 +35,12 @@ public byte Inst long _pos = m_io.Pos; m_io.Seek(5); _inst = m_io.ReadU1(); - m_io.Seek(_pos); - f_inst = true; - if (!(Inst == 80)) + if (!(_inst == 80)) { - throw new ValidationNotEqualError(80, Inst, M_Io, "/instances/inst"); + throw new ValidationNotEqualError(80, _inst, m_io, "/instances/inst"); } + m_io.Seek(_pos); + f_inst = true; return _inst; } } diff --git a/compiled/csharp/ValidFailMaxInt.cs b/compiled/csharp/ValidFailMaxInt.cs index 7676f5418..942db3406 100644 --- a/compiled/csharp/ValidFailMaxInt.cs +++ b/compiled/csharp/ValidFailMaxInt.cs @@ -20,9 +20,9 @@ public ValidFailMaxInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidF private void _read() { _foo = m_io.ReadU1(); - if (!(Foo <= 12)) + if (!(_foo <= 12)) { - throw new ValidationGreaterThanError(12, Foo, M_Io, "/seq/0"); + throw new ValidationGreaterThanError(12, _foo, m_io, "/seq/0"); } } private byte _foo; diff --git a/compiled/csharp/ValidFailMinInt.cs b/compiled/csharp/ValidFailMinInt.cs index a811d41b4..69761fde7 100644 --- a/compiled/csharp/ValidFailMinInt.cs +++ b/compiled/csharp/ValidFailMinInt.cs @@ -20,9 +20,9 @@ public ValidFailMinInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidF private void _read() { _foo = m_io.ReadU1(); - if (!(Foo >= 123)) + if (!(_foo >= 123)) { - throw new ValidationLessThanError(123, Foo, M_Io, "/seq/0"); + throw new ValidationLessThanError(123, _foo, m_io, "/seq/0"); } } private byte _foo; diff --git a/compiled/csharp/ValidFailRangeBytes.cs b/compiled/csharp/ValidFailRangeBytes.cs index c4f310849..298a5eed4 100644 --- a/compiled/csharp/ValidFailRangeBytes.cs +++ b/compiled/csharp/ValidFailRangeBytes.cs @@ -20,13 +20,13 @@ public ValidFailRangeBytes(KaitaiStream p__io, KaitaiStruct p__parent = null, Va private void _read() { _foo = m_io.ReadBytes(2); - if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 80 }) >= 0))) + if (!((KaitaiStream.ByteArrayCompare(_foo, new byte[] { 80 }) >= 0))) { - throw new ValidationLessThanError(new byte[] { 80 }, Foo, M_Io, "/seq/0"); + throw new ValidationLessThanError(new byte[] { 80 }, _foo, m_io, "/seq/0"); } - if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 80, 49 }) <= 0))) + if (!((KaitaiStream.ByteArrayCompare(_foo, new byte[] { 80, 49 }) <= 0))) { - throw new ValidationGreaterThanError(new byte[] { 80, 49 }, Foo, M_Io, "/seq/0"); + throw new ValidationGreaterThanError(new byte[] { 80, 49 }, _foo, m_io, "/seq/0"); } } private byte[] _foo; diff --git a/compiled/csharp/ValidFailRangeFloat.cs b/compiled/csharp/ValidFailRangeFloat.cs index f71ff196b..e3bfeabaf 100644 --- a/compiled/csharp/ValidFailRangeFloat.cs +++ b/compiled/csharp/ValidFailRangeFloat.cs @@ -20,13 +20,13 @@ public ValidFailRangeFloat(KaitaiStream p__io, KaitaiStruct p__parent = null, Va private void _read() { _foo = m_io.ReadF4le(); - if (!(Foo >= 0.2)) + if (!(_foo >= 0.2)) { - throw new ValidationLessThanError(0.2, Foo, M_Io, "/seq/0"); + throw new ValidationLessThanError(0.2, _foo, m_io, "/seq/0"); } - if (!(Foo <= 0.4)) + if (!(_foo <= 0.4)) { - throw new ValidationGreaterThanError(0.4, Foo, M_Io, "/seq/0"); + throw new ValidationGreaterThanError(0.4, _foo, m_io, "/seq/0"); } } private float _foo; diff --git a/compiled/csharp/ValidFailRangeInt.cs b/compiled/csharp/ValidFailRangeInt.cs index f40939321..dcfbf1c2b 100644 --- a/compiled/csharp/ValidFailRangeInt.cs +++ b/compiled/csharp/ValidFailRangeInt.cs @@ -20,13 +20,13 @@ public ValidFailRangeInt(KaitaiStream p__io, KaitaiStruct p__parent = null, Vali private void _read() { _foo = m_io.ReadU1(); - if (!(Foo >= 5)) + if (!(_foo >= 5)) { - throw new ValidationLessThanError(5, Foo, M_Io, "/seq/0"); + throw new ValidationLessThanError(5, _foo, m_io, "/seq/0"); } - if (!(Foo <= 10)) + if (!(_foo <= 10)) { - throw new ValidationGreaterThanError(10, Foo, M_Io, "/seq/0"); + throw new ValidationGreaterThanError(10, _foo, m_io, "/seq/0"); } } private byte _foo; diff --git a/compiled/csharp/ValidFailRangeStr.cs b/compiled/csharp/ValidFailRangeStr.cs index 7cfd92b41..8608998c2 100644 --- a/compiled/csharp/ValidFailRangeStr.cs +++ b/compiled/csharp/ValidFailRangeStr.cs @@ -20,13 +20,13 @@ public ValidFailRangeStr(KaitaiStream p__io, KaitaiStruct p__parent = null, Vali private void _read() { _foo = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(2)); - if (!((Foo.CompareTo("P") >= 0))) + if (!((_foo.CompareTo("P") >= 0))) { - throw new ValidationLessThanError("P", Foo, M_Io, "/seq/0"); + throw new ValidationLessThanError("P", _foo, m_io, "/seq/0"); } - if (!((Foo.CompareTo("P1") <= 0))) + if (!((_foo.CompareTo("P1") <= 0))) { - throw new ValidationGreaterThanError("P1", Foo, M_Io, "/seq/0"); + throw new ValidationGreaterThanError("P1", _foo, m_io, "/seq/0"); } } private string _foo; diff --git a/compiled/csharp/ValidFailRepeatAnyofInt.cs b/compiled/csharp/ValidFailRepeatAnyofInt.cs new file mode 100644 index 000000000..0f4567669 --- /dev/null +++ b/compiled/csharp/ValidFailRepeatAnyofInt.cs @@ -0,0 +1,42 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatAnyofInt : KaitaiStruct + { + public static ValidFailRepeatAnyofInt FromFile(string fileName) + { + return new ValidFailRepeatAnyofInt(new KaitaiStream(fileName)); + } + + public ValidFailRepeatAnyofInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatAnyofInt p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadU1()); + if (!( ((_foo[i] == 0) || (_foo[i] == 1) || (_foo[i] == 65)) )) + { + throw new ValidationNotAnyOfError(_foo[i], m_io, "/seq/0"); + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatAnyofInt m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatAnyofInt M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatContents.cs b/compiled/csharp/ValidFailRepeatContents.cs new file mode 100644 index 000000000..989606577 --- /dev/null +++ b/compiled/csharp/ValidFailRepeatContents.cs @@ -0,0 +1,42 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatContents : KaitaiStruct + { + public static ValidFailRepeatContents FromFile(string fileName) + { + return new ValidFailRepeatContents(new KaitaiStream(fileName)); + } + + public ValidFailRepeatContents(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatContents p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadBytes(4)); + if (!((KaitaiStream.ByteArrayCompare(_foo[i], new byte[] { 18, 52, 86, 120 }) == 0))) + { + throw new ValidationNotEqualError(new byte[] { 18, 52, 86, 120 }, _foo[i], m_io, "/seq/0"); + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatContents m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatContents M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatEqInt.cs b/compiled/csharp/ValidFailRepeatEqInt.cs new file mode 100644 index 000000000..cd4a5e1b5 --- /dev/null +++ b/compiled/csharp/ValidFailRepeatEqInt.cs @@ -0,0 +1,42 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatEqInt : KaitaiStruct + { + public static ValidFailRepeatEqInt FromFile(string fileName) + { + return new ValidFailRepeatEqInt(new KaitaiStream(fileName)); + } + + public ValidFailRepeatEqInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatEqInt p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadU4be()); + if (!(_foo[i] == 305419896)) + { + throw new ValidationNotEqualError(305419896, _foo[i], m_io, "/seq/0"); + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatEqInt m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatEqInt M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatExpr.cs b/compiled/csharp/ValidFailRepeatExpr.cs new file mode 100644 index 000000000..2226f664f --- /dev/null +++ b/compiled/csharp/ValidFailRepeatExpr.cs @@ -0,0 +1,45 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatExpr : KaitaiStruct + { + public static ValidFailRepeatExpr FromFile(string fileName) + { + return new ValidFailRepeatExpr(new KaitaiStream(fileName)); + } + + public ValidFailRepeatExpr(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatExpr p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadBytes(4)); + { + byte[] M_ = _foo[i]; + if (!((KaitaiStream.ByteArrayCompare(M_, new byte[] { 0, 18, 52, 86 }) != 0))) + { + throw new ValidationExprError(_foo[i], m_io, "/seq/0"); + } + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatExpr m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatExpr M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatInst.cs b/compiled/csharp/ValidFailRepeatInst.cs new file mode 100644 index 000000000..2a6cb7acf --- /dev/null +++ b/compiled/csharp/ValidFailRepeatInst.cs @@ -0,0 +1,61 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatInst : KaitaiStruct + { + public static ValidFailRepeatInst FromFile(string fileName) + { + return new ValidFailRepeatInst(new KaitaiStream(fileName)); + } + + public ValidFailRepeatInst(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatInst p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + f_inst = false; + _read(); + } + private void _read() + { + if (Inst.Count == 0) { + _a = m_io.ReadBytes(0); + } + } + private bool f_inst; + private List _inst; + public List Inst + { + get + { + if (f_inst) + return _inst; + long _pos = m_io.Pos; + m_io.Seek(0); + _inst = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _inst.Add(m_io.ReadU4be()); + if (!(_inst[i] == 305419896)) + { + throw new ValidationNotEqualError(305419896, _inst[i], m_io, "/instances/inst"); + } + i++; + } + } + m_io.Seek(_pos); + f_inst = true; + return _inst; + } + } + private byte[] _a; + private ValidFailRepeatInst m_root; + private KaitaiStruct m_parent; + public byte[] A { get { return _a; } } + public ValidFailRepeatInst M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatMaxInt.cs b/compiled/csharp/ValidFailRepeatMaxInt.cs new file mode 100644 index 000000000..405549f40 --- /dev/null +++ b/compiled/csharp/ValidFailRepeatMaxInt.cs @@ -0,0 +1,42 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatMaxInt : KaitaiStruct + { + public static ValidFailRepeatMaxInt FromFile(string fileName) + { + return new ValidFailRepeatMaxInt(new KaitaiStream(fileName)); + } + + public ValidFailRepeatMaxInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatMaxInt p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadU1()); + if (!(_foo[i] <= 254)) + { + throw new ValidationGreaterThanError(254, _foo[i], m_io, "/seq/0"); + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatMaxInt m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatMaxInt M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidFailRepeatMinInt.cs b/compiled/csharp/ValidFailRepeatMinInt.cs new file mode 100644 index 000000000..1e1bf2254 --- /dev/null +++ b/compiled/csharp/ValidFailRepeatMinInt.cs @@ -0,0 +1,42 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +using System.Collections.Generic; + +namespace Kaitai +{ + public partial class ValidFailRepeatMinInt : KaitaiStruct + { + public static ValidFailRepeatMinInt FromFile(string fileName) + { + return new ValidFailRepeatMinInt(new KaitaiStream(fileName)); + } + + public ValidFailRepeatMinInt(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidFailRepeatMinInt p__root = null) : base(p__io) + { + m_parent = p__parent; + m_root = p__root ?? this; + _read(); + } + private void _read() + { + _foo = new List(); + { + var i = 0; + while (!m_io.IsEof) { + _foo.Add(m_io.ReadS1()); + if (!(_foo[i] >= 0)) + { + throw new ValidationLessThanError(0, _foo[i], m_io, "/seq/0"); + } + i++; + } + } + } + private List _foo; + private ValidFailRepeatMinInt m_root; + private KaitaiStruct m_parent; + public List Foo { get { return _foo; } } + public ValidFailRepeatMinInt M_Root { get { return m_root; } } + public KaitaiStruct M_Parent { get { return m_parent; } } + } +} diff --git a/compiled/csharp/ValidLong.cs b/compiled/csharp/ValidLong.cs index 9f84a0c87..a5285d3c3 100644 --- a/compiled/csharp/ValidLong.cs +++ b/compiled/csharp/ValidLong.cs @@ -20,59 +20,59 @@ public ValidLong(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidLong p_ private void _read() { _magic1 = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _magic1, m_io, "/seq/0"); } _uint8 = m_io.ReadU1(); - if (!(Uint8 == 255)) + if (!(_uint8 == 255)) { - throw new ValidationNotEqualError(255, Uint8, M_Io, "/seq/1"); + throw new ValidationNotEqualError(255, _uint8, m_io, "/seq/1"); } _sint8 = m_io.ReadS1(); - if (!(Sint8 == -1)) + if (!(_sint8 == -1)) { - throw new ValidationNotEqualError(-1, Sint8, M_Io, "/seq/2"); + throw new ValidationNotEqualError(-1, _sint8, m_io, "/seq/2"); } _magicUint = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(10)); - if (!(MagicUint == "PACK-U-DEF")) + if (!(_magicUint == "PACK-U-DEF")) { - throw new ValidationNotEqualError("PACK-U-DEF", MagicUint, M_Io, "/seq/3"); + throw new ValidationNotEqualError("PACK-U-DEF", _magicUint, m_io, "/seq/3"); } _uint16 = m_io.ReadU2le(); - if (!(Uint16 == 65535)) + if (!(_uint16 == 65535)) { - throw new ValidationNotEqualError(65535, Uint16, M_Io, "/seq/4"); + throw new ValidationNotEqualError(65535, _uint16, m_io, "/seq/4"); } _uint32 = m_io.ReadU4le(); - if (!(Uint32 == 4294967295)) + if (!(_uint32 == 4294967295)) { - throw new ValidationNotEqualError(4294967295, Uint32, M_Io, "/seq/5"); + throw new ValidationNotEqualError(4294967295, _uint32, m_io, "/seq/5"); } _uint64 = m_io.ReadU8le(); - if (!(Uint64 == 18446744073709551615)) + if (!(_uint64 == 18446744073709551615)) { - throw new ValidationNotEqualError(18446744073709551615, Uint64, M_Io, "/seq/6"); + throw new ValidationNotEqualError(18446744073709551615, _uint64, m_io, "/seq/6"); } _magicSint = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(10)); - if (!(MagicSint == "PACK-S-DEF")) + if (!(_magicSint == "PACK-S-DEF")) { - throw new ValidationNotEqualError("PACK-S-DEF", MagicSint, M_Io, "/seq/7"); + throw new ValidationNotEqualError("PACK-S-DEF", _magicSint, m_io, "/seq/7"); } _sint16 = m_io.ReadS2le(); - if (!(Sint16 == -1)) + if (!(_sint16 == -1)) { - throw new ValidationNotEqualError(-1, Sint16, M_Io, "/seq/8"); + throw new ValidationNotEqualError(-1, _sint16, m_io, "/seq/8"); } _sint32 = m_io.ReadS4le(); - if (!(Sint32 == -1)) + if (!(_sint32 == -1)) { - throw new ValidationNotEqualError(-1, Sint32, M_Io, "/seq/9"); + throw new ValidationNotEqualError(-1, _sint32, m_io, "/seq/9"); } _sint64 = m_io.ReadS8le(); - if (!(Sint64 == -1)) + if (!(_sint64 == -1)) { - throw new ValidationNotEqualError(-1, Sint64, M_Io, "/seq/10"); + throw new ValidationNotEqualError(-1, _sint64, m_io, "/seq/10"); } } private byte[] _magic1; diff --git a/compiled/csharp/ValidNotParsedIf.cs b/compiled/csharp/ValidNotParsedIf.cs index a728b60fe..0db53ff6f 100644 --- a/compiled/csharp/ValidNotParsedIf.cs +++ b/compiled/csharp/ValidNotParsedIf.cs @@ -21,16 +21,16 @@ private void _read() { if (false) { _notParsed = m_io.ReadU1(); - if (!(NotParsed == 42)) + if (!(_notParsed == 42)) { - throw new ValidationNotEqualError(42, NotParsed, M_Io, "/seq/0"); + throw new ValidationNotEqualError(42, _notParsed, m_io, "/seq/0"); } } if (true) { _parsed = m_io.ReadU1(); - if (!(Parsed == 80)) + if (!(_parsed == 80)) { - throw new ValidationNotEqualError(80, Parsed, M_Io, "/seq/1"); + throw new ValidationNotEqualError(80, _parsed, m_io, "/seq/1"); } } } diff --git a/compiled/csharp/ValidOptionalId.cs b/compiled/csharp/ValidOptionalId.cs index e68990ec8..18ef09858 100644 --- a/compiled/csharp/ValidOptionalId.cs +++ b/compiled/csharp/ValidOptionalId.cs @@ -20,21 +20,21 @@ public ValidOptionalId(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidO private void _read() { __unnamed0 = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Unnamed_0, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(__unnamed0, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Unnamed_0, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, __unnamed0, m_io, "/seq/0"); } __unnamed1 = m_io.ReadU1(); - if (!(Unnamed_1 == 255)) + if (!(__unnamed1 == 255)) { - throw new ValidationNotEqualError(255, Unnamed_1, M_Io, "/seq/1"); + throw new ValidationNotEqualError(255, __unnamed1, m_io, "/seq/1"); } __unnamed2 = m_io.ReadS1(); { - sbyte M_ = Unnamed_2; + sbyte M_ = __unnamed2; if (!(M_ == -1)) { - throw new ValidationExprError(Unnamed_2, M_Io, "/seq/2"); + throw new ValidationExprError(__unnamed2, m_io, "/seq/2"); } } } diff --git a/compiled/csharp/ValidShort.cs b/compiled/csharp/ValidShort.cs index cb07f53b4..b83650910 100644 --- a/compiled/csharp/ValidShort.cs +++ b/compiled/csharp/ValidShort.cs @@ -20,59 +20,59 @@ public ValidShort(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidShort private void _read() { _magic1 = m_io.ReadBytes(6); - if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) + if (!((KaitaiStream.ByteArrayCompare(_magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0))) { - throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/seq/0"); + throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _magic1, m_io, "/seq/0"); } _uint8 = m_io.ReadU1(); - if (!(Uint8 == 255)) + if (!(_uint8 == 255)) { - throw new ValidationNotEqualError(255, Uint8, M_Io, "/seq/1"); + throw new ValidationNotEqualError(255, _uint8, m_io, "/seq/1"); } _sint8 = m_io.ReadS1(); - if (!(Sint8 == -1)) + if (!(_sint8 == -1)) { - throw new ValidationNotEqualError(-1, Sint8, M_Io, "/seq/2"); + throw new ValidationNotEqualError(-1, _sint8, m_io, "/seq/2"); } _magicUint = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(10)); - if (!(MagicUint == "PACK-U-DEF")) + if (!(_magicUint == "PACK-U-DEF")) { - throw new ValidationNotEqualError("PACK-U-DEF", MagicUint, M_Io, "/seq/3"); + throw new ValidationNotEqualError("PACK-U-DEF", _magicUint, m_io, "/seq/3"); } _uint16 = m_io.ReadU2le(); - if (!(Uint16 == 65535)) + if (!(_uint16 == 65535)) { - throw new ValidationNotEqualError(65535, Uint16, M_Io, "/seq/4"); + throw new ValidationNotEqualError(65535, _uint16, m_io, "/seq/4"); } _uint32 = m_io.ReadU4le(); - if (!(Uint32 == 4294967295)) + if (!(_uint32 == 4294967295)) { - throw new ValidationNotEqualError(4294967295, Uint32, M_Io, "/seq/5"); + throw new ValidationNotEqualError(4294967295, _uint32, m_io, "/seq/5"); } _uint64 = m_io.ReadU8le(); - if (!(Uint64 == 18446744073709551615)) + if (!(_uint64 == 18446744073709551615)) { - throw new ValidationNotEqualError(18446744073709551615, Uint64, M_Io, "/seq/6"); + throw new ValidationNotEqualError(18446744073709551615, _uint64, m_io, "/seq/6"); } _magicSint = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(10)); - if (!(MagicSint == "PACK-S-DEF")) + if (!(_magicSint == "PACK-S-DEF")) { - throw new ValidationNotEqualError("PACK-S-DEF", MagicSint, M_Io, "/seq/7"); + throw new ValidationNotEqualError("PACK-S-DEF", _magicSint, m_io, "/seq/7"); } _sint16 = m_io.ReadS2le(); - if (!(Sint16 == -1)) + if (!(_sint16 == -1)) { - throw new ValidationNotEqualError(-1, Sint16, M_Io, "/seq/8"); + throw new ValidationNotEqualError(-1, _sint16, m_io, "/seq/8"); } _sint32 = m_io.ReadS4le(); - if (!(Sint32 == -1)) + if (!(_sint32 == -1)) { - throw new ValidationNotEqualError(-1, Sint32, M_Io, "/seq/9"); + throw new ValidationNotEqualError(-1, _sint32, m_io, "/seq/9"); } _sint64 = m_io.ReadS8le(); - if (!(Sint64 == -1)) + if (!(_sint64 == -1)) { - throw new ValidationNotEqualError(-1, Sint64, M_Io, "/seq/10"); + throw new ValidationNotEqualError(-1, _sint64, m_io, "/seq/10"); } } private byte[] _magic1; diff --git a/compiled/csharp/ValidSwitch.cs b/compiled/csharp/ValidSwitch.cs index ccfee54c6..67a3ba3fd 100644 --- a/compiled/csharp/ValidSwitch.cs +++ b/compiled/csharp/ValidSwitch.cs @@ -20,9 +20,9 @@ public ValidSwitch(KaitaiStream p__io, KaitaiStruct p__parent = null, ValidSwitc private void _read() { _a = m_io.ReadU1(); - if (!(A == 80)) + if (!(_a == 80)) { - throw new ValidationNotEqualError(80, A, M_Io, "/seq/0"); + throw new ValidationNotEqualError(80, _a, m_io, "/seq/0"); } switch (A) { case 80: { @@ -34,9 +34,9 @@ private void _read() break; } } - if (!(B == 17217)) + if (!(_b == 17217)) { - throw new ValidationNotEqualError(17217, B, M_Io, "/seq/1"); + throw new ValidationNotEqualError(17217, _b, m_io, "/seq/1"); } } private byte _a; diff --git a/compiled/go/src/test_formats/default_endian_expr_exception.go b/compiled/go/src/test_formats/default_endian_expr_exception.go index 5f0ed3982..1e3859cb5 100644 --- a/compiled/go/src/test_formats/default_endian_expr_exception.go +++ b/compiled/go/src/test_formats/default_endian_expr_exception.go @@ -27,7 +27,7 @@ func (this *DefaultEndianExprException) Read(io *kaitai.Stream, parent kaitai.St this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/default_endian_expr_inherited.go b/compiled/go/src/test_formats/default_endian_expr_inherited.go index 03d7ad48f..63a7ae87b 100644 --- a/compiled/go/src/test_formats/default_endian_expr_inherited.go +++ b/compiled/go/src/test_formats/default_endian_expr_inherited.go @@ -28,7 +28,7 @@ func (this *DefaultEndianExprInherited) Read(io *kaitai.Stream, parent kaitai.St this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/default_endian_expr_is_be.go b/compiled/go/src/test_formats/default_endian_expr_is_be.go index 61b31418f..d144c9e04 100644 --- a/compiled/go/src/test_formats/default_endian_expr_is_be.go +++ b/compiled/go/src/test_formats/default_endian_expr_is_be.go @@ -28,7 +28,7 @@ func (this *DefaultEndianExprIsBe) Read(io *kaitai.Stream, parent kaitai.Struct, this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/default_endian_expr_is_le.go b/compiled/go/src/test_formats/default_endian_expr_is_le.go index a46bf91a2..9539a69db 100644 --- a/compiled/go/src/test_formats/default_endian_expr_is_le.go +++ b/compiled/go/src/test_formats/default_endian_expr_is_le.go @@ -27,7 +27,7 @@ func (this *DefaultEndianExprIsLe) Read(io *kaitai.Stream, parent kaitai.Struct, this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/index_to_param_eos.go b/compiled/go/src/test_formats/index_to_param_eos.go index a19b5ae41..98b3fcea1 100644 --- a/compiled/go/src/test_formats/index_to_param_eos.go +++ b/compiled/go/src/test_formats/index_to_param_eos.go @@ -39,7 +39,7 @@ func (this *IndexToParamEos) Read(io *kaitai.Stream, parent kaitai.Struct, root } this.Sizes = append(this.Sizes, tmp2) } - for i := 1;; i++ { + for i := 0;; i++ { tmp3, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/instance_io_user.go b/compiled/go/src/test_formats/instance_io_user.go index 1ae66632f..6470bb3d3 100644 --- a/compiled/go/src/test_formats/instance_io_user.go +++ b/compiled/go/src/test_formats/instance_io_user.go @@ -141,7 +141,7 @@ func (this *InstanceIoUser_StringsObj) Read(io *kaitai.Stream, parent *InstanceI this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp8, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/repeat_eos_bit.go b/compiled/go/src/test_formats/repeat_eos_bit.go index b6c313a33..9f3cf8e06 100644 --- a/compiled/go/src/test_formats/repeat_eos_bit.go +++ b/compiled/go/src/test_formats/repeat_eos_bit.go @@ -24,7 +24,7 @@ func (this *RepeatEosBit) Read(io *kaitai.Stream, parent kaitai.Struct, root *Re this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/repeat_eos_struct.go b/compiled/go/src/test_formats/repeat_eos_struct.go index d6a5bcd34..2beb89a96 100644 --- a/compiled/go/src/test_formats/repeat_eos_struct.go +++ b/compiled/go/src/test_formats/repeat_eos_struct.go @@ -24,7 +24,7 @@ func (this *RepeatEosStruct) Read(io *kaitai.Stream, parent kaitai.Struct, root this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/repeat_eos_u4.go b/compiled/go/src/test_formats/repeat_eos_u4.go index 46903d91b..227f48f7b 100644 --- a/compiled/go/src/test_formats/repeat_eos_u4.go +++ b/compiled/go/src/test_formats/repeat_eos_u4.go @@ -24,7 +24,7 @@ func (this *RepeatEosU4) Read(io *kaitai.Stream, parent kaitai.Struct, root *Rep this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/str_pad_term_utf16.go b/compiled/go/src/test_formats/str_pad_term_utf16.go new file mode 100644 index 000000000..a8c84754a --- /dev/null +++ b/compiled/go/src/test_formats/str_pad_term_utf16.go @@ -0,0 +1,63 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "golang.org/x/text/encoding/unicode" +) + +type StrPadTermUtf16 struct { + StrTerm string + StrTermInclude string + StrTermAndPad string + _io *kaitai.Stream + _root *StrPadTermUtf16 + _parent kaitai.Struct +} +func NewStrPadTermUtf16() *StrPadTermUtf16 { + return &StrPadTermUtf16{ + } +} + +func (this StrPadTermUtf16) IO_() *kaitai.Stream { + return this._io +} + +func (this *StrPadTermUtf16) Read(io *kaitai.Stream, parent kaitai.Struct, root *StrPadTermUtf16) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this._io.ReadBytes(int(10)) + if err != nil { + return err + } + tmp1 = kaitai.BytesTerminateMulti(tmp1, []uint8{0, 0}, false) + tmp2, err := kaitai.BytesToStr(tmp1, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.StrTerm = tmp2 + tmp3, err := this._io.ReadBytes(int(10)) + if err != nil { + return err + } + tmp3 = kaitai.BytesTerminateMulti(tmp3, []uint8{0, 0}, true) + tmp4, err := kaitai.BytesToStr(tmp3, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.StrTermInclude = tmp4 + tmp5, err := this._io.ReadBytes(int(9)) + if err != nil { + return err + } + tmp5 = kaitai.BytesTerminateMulti(kaitai.BytesStripRight(tmp5, 43), []uint8{0, 0}, false) + tmp6, err := kaitai.BytesToStr(tmp5, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.StrTermAndPad = tmp6 + return err +} diff --git a/compiled/go/src/test_formats/switch_bytearray.go b/compiled/go/src/test_formats/switch_bytearray.go index a5cb87919..2b93c26bc 100644 --- a/compiled/go/src/test_formats/switch_bytearray.go +++ b/compiled/go/src/test_formats/switch_bytearray.go @@ -27,7 +27,7 @@ func (this *SwitchBytearray) Read(io *kaitai.Stream, parent kaitai.Struct, root this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_integers.go b/compiled/go/src/test_formats/switch_integers.go index ca46c0445..65dbf9bb1 100644 --- a/compiled/go/src/test_formats/switch_integers.go +++ b/compiled/go/src/test_formats/switch_integers.go @@ -24,7 +24,7 @@ func (this *SwitchIntegers) Read(io *kaitai.Stream, parent kaitai.Struct, root * this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_enum.go b/compiled/go/src/test_formats/switch_manual_enum.go index d65c458c3..cb09aa9a7 100644 --- a/compiled/go/src/test_formats/switch_manual_enum.go +++ b/compiled/go/src/test_formats/switch_manual_enum.go @@ -24,7 +24,7 @@ func (this *SwitchManualEnum) Read(io *kaitai.Stream, parent kaitai.Struct, root this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_enum_invalid.go b/compiled/go/src/test_formats/switch_manual_enum_invalid.go index 325667868..b144bba92 100644 --- a/compiled/go/src/test_formats/switch_manual_enum_invalid.go +++ b/compiled/go/src/test_formats/switch_manual_enum_invalid.go @@ -24,7 +24,7 @@ func (this *SwitchManualEnumInvalid) Read(io *kaitai.Stream, parent kaitai.Struc this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_enum_invalid_else.go b/compiled/go/src/test_formats/switch_manual_enum_invalid_else.go index 057cb45d1..037c1715c 100644 --- a/compiled/go/src/test_formats/switch_manual_enum_invalid_else.go +++ b/compiled/go/src/test_formats/switch_manual_enum_invalid_else.go @@ -24,7 +24,7 @@ func (this *SwitchManualEnumInvalidElse) Read(io *kaitai.Stream, parent kaitai.S this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_int.go b/compiled/go/src/test_formats/switch_manual_int.go index 9973302f0..0ea90c615 100644 --- a/compiled/go/src/test_formats/switch_manual_int.go +++ b/compiled/go/src/test_formats/switch_manual_int.go @@ -24,7 +24,7 @@ func (this *SwitchManualInt) Read(io *kaitai.Stream, parent kaitai.Struct, root this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_int_else.go b/compiled/go/src/test_formats/switch_manual_int_else.go index e61a940b3..b0df8494b 100644 --- a/compiled/go/src/test_formats/switch_manual_int_else.go +++ b/compiled/go/src/test_formats/switch_manual_int_else.go @@ -24,7 +24,7 @@ func (this *SwitchManualIntElse) Read(io *kaitai.Stream, parent kaitai.Struct, r this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_int_size.go b/compiled/go/src/test_formats/switch_manual_int_size.go index f5a8f2c9c..a962b519f 100644 --- a/compiled/go/src/test_formats/switch_manual_int_size.go +++ b/compiled/go/src/test_formats/switch_manual_int_size.go @@ -27,7 +27,7 @@ func (this *SwitchManualIntSize) Read(io *kaitai.Stream, parent kaitai.Struct, r this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err @@ -136,7 +136,7 @@ func (this *SwitchManualIntSize_Chunk_ChunkDir) Read(io *kaitai.Stream, parent * this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp10, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_int_size_else.go b/compiled/go/src/test_formats/switch_manual_int_size_else.go index b788f7db2..ec7ac2ea0 100644 --- a/compiled/go/src/test_formats/switch_manual_int_size_else.go +++ b/compiled/go/src/test_formats/switch_manual_int_size_else.go @@ -27,7 +27,7 @@ func (this *SwitchManualIntSizeElse) Read(io *kaitai.Stream, parent kaitai.Struc this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err @@ -143,7 +143,7 @@ func (this *SwitchManualIntSizeElse_Chunk_ChunkDir) Read(io *kaitai.Stream, pare this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp11, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_int_size_eos.go b/compiled/go/src/test_formats/switch_manual_int_size_eos.go index dfd26e464..f1acce19c 100644 --- a/compiled/go/src/test_formats/switch_manual_int_size_eos.go +++ b/compiled/go/src/test_formats/switch_manual_int_size_eos.go @@ -27,7 +27,7 @@ func (this *SwitchManualIntSizeEos) Read(io *kaitai.Stream, parent kaitai.Struct this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err @@ -172,7 +172,7 @@ func (this *SwitchManualIntSizeEos_ChunkBody_ChunkDir) Read(io *kaitai.Stream, p this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp12, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_str.go b/compiled/go/src/test_formats/switch_manual_str.go index 7404bf56e..181a64bd8 100644 --- a/compiled/go/src/test_formats/switch_manual_str.go +++ b/compiled/go/src/test_formats/switch_manual_str.go @@ -24,7 +24,7 @@ func (this *SwitchManualStr) Read(io *kaitai.Stream, parent kaitai.Struct, root this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_manual_str_else.go b/compiled/go/src/test_formats/switch_manual_str_else.go index 7135a2354..e4ccd86c2 100644 --- a/compiled/go/src/test_formats/switch_manual_str_else.go +++ b/compiled/go/src/test_formats/switch_manual_str_else.go @@ -24,7 +24,7 @@ func (this *SwitchManualStrElse) Read(io *kaitai.Stream, parent kaitai.Struct, r this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/switch_multi_bool_ops.go b/compiled/go/src/test_formats/switch_multi_bool_ops.go index c73c80317..79a5cdffd 100644 --- a/compiled/go/src/test_formats/switch_multi_bool_ops.go +++ b/compiled/go/src/test_formats/switch_multi_bool_ops.go @@ -24,7 +24,7 @@ func (this *SwitchMultiBoolOps) Read(io *kaitai.Stream, parent kaitai.Struct, ro this._parent = parent this._root = root - for i := 1;; i++ { + for i := 0;; i++ { tmp1, err := this._io.EOF() if err != nil { return err diff --git a/compiled/go/src/test_formats/term_strz_utf16_v1.go b/compiled/go/src/test_formats/term_strz_utf16_v1.go new file mode 100644 index 000000000..17b293014 --- /dev/null +++ b/compiled/go/src/test_formats/term_strz_utf16_v1.go @@ -0,0 +1,66 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "golang.org/x/text/encoding/unicode" +) + +type TermStrzUtf16V1 struct { + S1 string + S2 string + Term uint16 + S3 string + _io *kaitai.Stream + _root *TermStrzUtf16V1 + _parent kaitai.Struct +} +func NewTermStrzUtf16V1() *TermStrzUtf16V1 { + return &TermStrzUtf16V1{ + } +} + +func (this TermStrzUtf16V1) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V1) Read(io *kaitai.Stream, parent kaitai.Struct, root *TermStrzUtf16V1) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, true, true) + if err != nil { + return err + } + tmp2, err := kaitai.BytesToStr(tmp1, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S1 = tmp2 + tmp3, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, false, true) + if err != nil { + return err + } + tmp4, err := kaitai.BytesToStr(tmp3, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S2 = tmp4 + tmp5, err := this._io.ReadU2le() + if err != nil { + return err + } + this.Term = uint16(tmp5) + tmp6, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, true, true, true) + if err != nil { + return err + } + tmp7, err := kaitai.BytesToStr(tmp6, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S3 = tmp7 + return err +} diff --git a/compiled/go/src/test_formats/term_strz_utf16_v2.go b/compiled/go/src/test_formats/term_strz_utf16_v2.go new file mode 100644 index 000000000..f6f53de1f --- /dev/null +++ b/compiled/go/src/test_formats/term_strz_utf16_v2.go @@ -0,0 +1,60 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "golang.org/x/text/encoding/unicode" +) + +type TermStrzUtf16V2 struct { + S1 string + S2 string + S3 string + _io *kaitai.Stream + _root *TermStrzUtf16V2 + _parent kaitai.Struct +} +func NewTermStrzUtf16V2() *TermStrzUtf16V2 { + return &TermStrzUtf16V2{ + } +} + +func (this TermStrzUtf16V2) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V2) Read(io *kaitai.Stream, parent kaitai.Struct, root *TermStrzUtf16V2) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, true, true) + if err != nil { + return err + } + tmp2, err := kaitai.BytesToStr(tmp1, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S1 = tmp2 + tmp3, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, true, true, true) + if err != nil { + return err + } + tmp4, err := kaitai.BytesToStr(tmp3, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S2 = tmp4 + tmp5, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, false, true) + if err != nil { + return err + } + tmp6, err := kaitai.BytesToStr(tmp5, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S3 = tmp6 + return err +} diff --git a/compiled/go/src/test_formats/term_strz_utf16_v3.go b/compiled/go/src/test_formats/term_strz_utf16_v3.go new file mode 100644 index 000000000..35c64ab61 --- /dev/null +++ b/compiled/go/src/test_formats/term_strz_utf16_v3.go @@ -0,0 +1,66 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "golang.org/x/text/encoding/unicode" +) + +type TermStrzUtf16V3 struct { + S1 string + Term uint16 + S2 string + S3 string + _io *kaitai.Stream + _root *TermStrzUtf16V3 + _parent kaitai.Struct +} +func NewTermStrzUtf16V3() *TermStrzUtf16V3 { + return &TermStrzUtf16V3{ + } +} + +func (this TermStrzUtf16V3) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V3) Read(io *kaitai.Stream, parent kaitai.Struct, root *TermStrzUtf16V3) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, false, true) + if err != nil { + return err + } + tmp2, err := kaitai.BytesToStr(tmp1, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S1 = tmp2 + tmp3, err := this._io.ReadU2le() + if err != nil { + return err + } + this.Term = uint16(tmp3) + tmp4, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, false, true) + if err != nil { + return err + } + tmp5, err := kaitai.BytesToStr(tmp4, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S2 = tmp5 + tmp6, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, true, true) + if err != nil { + return err + } + tmp7, err := kaitai.BytesToStr(tmp6, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.S3 = tmp7 + return err +} diff --git a/compiled/go/src/test_formats/term_strz_utf16_v4.go b/compiled/go/src/test_formats/term_strz_utf16_v4.go new file mode 100644 index 000000000..d065f9a5f --- /dev/null +++ b/compiled/go/src/test_formats/term_strz_utf16_v4.go @@ -0,0 +1,183 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "bytes" + "golang.org/x/text/encoding/unicode" +) + +type TermStrzUtf16V4 struct { + S1 *TermStrzUtf16V4_S1Type + SkipTerm1 []byte + S2 *TermStrzUtf16V4_S2Type + SkipTerm2 []byte + S3 *TermStrzUtf16V4_S3Type + _io *kaitai.Stream + _root *TermStrzUtf16V4 + _parent kaitai.Struct + _raw_S1 []byte + _raw_S2 []byte + _raw_S3 []byte +} +func NewTermStrzUtf16V4() *TermStrzUtf16V4 { + return &TermStrzUtf16V4{ + } +} + +func (this TermStrzUtf16V4) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V4) Read(io *kaitai.Stream, parent kaitai.Struct, root *TermStrzUtf16V4) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this._io.ReadBytes(int(6)) + if err != nil { + return err + } + tmp1 = tmp1 + this._raw_S1 = tmp1 + _io__raw_S1 := kaitai.NewStream(bytes.NewReader(this._raw_S1)) + tmp2 := NewTermStrzUtf16V4_S1Type() + err = tmp2.Read(_io__raw_S1, this, this._root) + if err != nil { + return err + } + this.S1 = tmp2 + tmp3, err := this._io.ReadBytes(int(2)) + if err != nil { + return err + } + tmp3 = tmp3 + this.SkipTerm1 = tmp3 + tmp4, err := this._io.ReadBytes(int(6)) + if err != nil { + return err + } + tmp4 = tmp4 + this._raw_S2 = tmp4 + _io__raw_S2 := kaitai.NewStream(bytes.NewReader(this._raw_S2)) + tmp5 := NewTermStrzUtf16V4_S2Type() + err = tmp5.Read(_io__raw_S2, this, this._root) + if err != nil { + return err + } + this.S2 = tmp5 + tmp6, err := this._io.ReadBytes(int(2)) + if err != nil { + return err + } + tmp6 = tmp6 + this.SkipTerm2 = tmp6 + tmp7, err := this._io.ReadBytes(int(6)) + if err != nil { + return err + } + tmp7 = tmp7 + this._raw_S3 = tmp7 + _io__raw_S3 := kaitai.NewStream(bytes.NewReader(this._raw_S3)) + tmp8 := NewTermStrzUtf16V4_S3Type() + err = tmp8.Read(_io__raw_S3, this, this._root) + if err != nil { + return err + } + this.S3 = tmp8 + return err +} +type TermStrzUtf16V4_S1Type struct { + Value string + _io *kaitai.Stream + _root *TermStrzUtf16V4 + _parent *TermStrzUtf16V4 +} +func NewTermStrzUtf16V4_S1Type() *TermStrzUtf16V4_S1Type { + return &TermStrzUtf16V4_S1Type{ + } +} + +func (this TermStrzUtf16V4_S1Type) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V4_S1Type) Read(io *kaitai.Stream, parent *TermStrzUtf16V4, root *TermStrzUtf16V4) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp9, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, true, false) + if err != nil { + return err + } + tmp10, err := kaitai.BytesToStr(tmp9, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.Value = tmp10 + return err +} +type TermStrzUtf16V4_S2Type struct { + Value string + _io *kaitai.Stream + _root *TermStrzUtf16V4 + _parent *TermStrzUtf16V4 +} +func NewTermStrzUtf16V4_S2Type() *TermStrzUtf16V4_S2Type { + return &TermStrzUtf16V4_S2Type{ + } +} + +func (this TermStrzUtf16V4_S2Type) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V4_S2Type) Read(io *kaitai.Stream, parent *TermStrzUtf16V4, root *TermStrzUtf16V4) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp11, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, false, false, false) + if err != nil { + return err + } + tmp12, err := kaitai.BytesToStr(tmp11, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.Value = tmp12 + return err +} +type TermStrzUtf16V4_S3Type struct { + Value string + _io *kaitai.Stream + _root *TermStrzUtf16V4 + _parent *TermStrzUtf16V4 +} +func NewTermStrzUtf16V4_S3Type() *TermStrzUtf16V4_S3Type { + return &TermStrzUtf16V4_S3Type{ + } +} + +func (this TermStrzUtf16V4_S3Type) IO_() *kaitai.Stream { + return this._io +} + +func (this *TermStrzUtf16V4_S3Type) Read(io *kaitai.Stream, parent *TermStrzUtf16V4, root *TermStrzUtf16V4) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp13, err := this._io.ReadBytesTermMulti([]uint8{0, 0}, true, true, false) + if err != nil { + return err + } + tmp14, err := kaitai.BytesToStr(tmp13, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewDecoder()) + if err != nil { + return err + } + this.Value = tmp14 + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_inst.go b/compiled/go/src/test_formats/valid_fail_inst.go index 0c3566784..07bb00a52 100644 --- a/compiled/go/src/test_formats/valid_fail_inst.go +++ b/compiled/go/src/test_formats/valid_fail_inst.go @@ -59,22 +59,14 @@ func (this *ValidFailInst) Inst() (v uint8, err error) { return 0, err } this.inst = tmp3 + if !(this.inst == 80) { + return 0, kaitai.NewValidationNotEqualError(80, this.inst, this._io, "/instances/inst") + } _, err = this._io.Seek(_pos, io.SeekStart) if err != nil { return 0, err } this._f_inst = true - tmp4, err := this.Inst() - if err != nil { - return 0, err - } - tmp5, err := this.Inst() - if err != nil { - return 0, err - } - if !(tmp5 == 80) { - return 0, kaitai.NewValidationNotEqualError(80, tmp4, this._io, "/instances/inst") - } this._f_inst = true return this.inst, nil } diff --git a/compiled/go/src/test_formats/valid_fail_repeat_anyof_int.go b/compiled/go/src/test_formats/valid_fail_repeat_anyof_int.go new file mode 100644 index 000000000..60e0af7c3 --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_anyof_int.go @@ -0,0 +1,45 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + +type ValidFailRepeatAnyofInt struct { + Foo []uint8 + _io *kaitai.Stream + _root *ValidFailRepeatAnyofInt + _parent kaitai.Struct +} +func NewValidFailRepeatAnyofInt() *ValidFailRepeatAnyofInt { + return &ValidFailRepeatAnyofInt{ + } +} + +func (this ValidFailRepeatAnyofInt) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatAnyofInt) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatAnyofInt) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadU1() + if err != nil { + return err + } + this.Foo = append(this.Foo, tmp2) + if !( ((this.Foo[i] == 0) || (this.Foo[i] == 1) || (this.Foo[i] == 65)) ) { + return kaitai.NewValidationNotAnyOfError(this.Foo[i], this._io, "/seq/0") + } + } + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_contents.go b/compiled/go/src/test_formats/valid_fail_repeat_contents.go new file mode 100644 index 000000000..22ae7e20d --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_contents.go @@ -0,0 +1,49 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "bytes" +) + +type ValidFailRepeatContents struct { + Foo [][]byte + _io *kaitai.Stream + _root *ValidFailRepeatContents + _parent kaitai.Struct +} +func NewValidFailRepeatContents() *ValidFailRepeatContents { + return &ValidFailRepeatContents{ + } +} + +func (this ValidFailRepeatContents) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatContents) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatContents) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadBytes(int(4)) + if err != nil { + return err + } + tmp2 = tmp2 + this.Foo = append(this.Foo, tmp2) + if !(bytes.Equal(this.Foo[i], []uint8{18, 52, 86, 120})) { + return kaitai.NewValidationNotEqualError([]uint8{18, 52, 86, 120}, this.Foo[i], this._io, "/seq/0") + } + } + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_eq_int.go b/compiled/go/src/test_formats/valid_fail_repeat_eq_int.go new file mode 100644 index 000000000..4ec7aee54 --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_eq_int.go @@ -0,0 +1,45 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + +type ValidFailRepeatEqInt struct { + Foo []uint32 + _io *kaitai.Stream + _root *ValidFailRepeatEqInt + _parent kaitai.Struct +} +func NewValidFailRepeatEqInt() *ValidFailRepeatEqInt { + return &ValidFailRepeatEqInt{ + } +} + +func (this ValidFailRepeatEqInt) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatEqInt) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatEqInt) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadU4be() + if err != nil { + return err + } + this.Foo = append(this.Foo, tmp2) + if !(this.Foo[i] == 305419896) { + return kaitai.NewValidationNotEqualError(305419896, this.Foo[i], this._io, "/seq/0") + } + } + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_expr.go b/compiled/go/src/test_formats/valid_fail_repeat_expr.go new file mode 100644 index 000000000..136c16dcb --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_expr.go @@ -0,0 +1,52 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "bytes" +) + +type ValidFailRepeatExpr struct { + Foo [][]byte + _io *kaitai.Stream + _root *ValidFailRepeatExpr + _parent kaitai.Struct +} +func NewValidFailRepeatExpr() *ValidFailRepeatExpr { + return &ValidFailRepeatExpr{ + } +} + +func (this ValidFailRepeatExpr) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatExpr) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatExpr) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadBytes(int(4)) + if err != nil { + return err + } + tmp2 = tmp2 + this.Foo = append(this.Foo, tmp2) + { + _it := this.Foo[i] + if !((bytes.Compare(_it, []uint8{0, 18, 52, 86}) != 0)) { + return kaitai.NewValidationExprError(this.Foo[i], this._io, "/seq/0") + } + } + } + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_inst.go b/compiled/go/src/test_formats/valid_fail_repeat_inst.go new file mode 100644 index 000000000..f6a5f6583 --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_inst.go @@ -0,0 +1,82 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import ( + "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + "io" +) + +type ValidFailRepeatInst struct { + A []byte + _io *kaitai.Stream + _root *ValidFailRepeatInst + _parent kaitai.Struct + _f_inst bool + inst []uint32 +} +func NewValidFailRepeatInst() *ValidFailRepeatInst { + return &ValidFailRepeatInst{ + } +} + +func (this ValidFailRepeatInst) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatInst) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatInst) (err error) { + this._io = io + this._parent = parent + this._root = root + + tmp1, err := this.Inst() + if err != nil { + return err + } + if (len(tmp1) == 0) { + tmp2, err := this._io.ReadBytes(int(0)) + if err != nil { + return err + } + tmp2 = tmp2 + this.A = tmp2 + } + return err +} +func (this *ValidFailRepeatInst) Inst() (v []uint32, err error) { + if (this._f_inst) { + return this.inst, nil + } + _pos, err := this._io.Pos() + if err != nil { + return nil, err + } + _, err = this._io.Seek(int64(0), io.SeekStart) + if err != nil { + return nil, err + } + for i := 0;; i++ { + tmp3, err := this._io.EOF() + if err != nil { + return nil, err + } + if tmp3 { + break + } + tmp4, err := this._io.ReadU4be() + if err != nil { + return nil, err + } + this.inst = append(this.inst, tmp4) + if !(this.inst[i] == 305419896) { + return nil, kaitai.NewValidationNotEqualError(305419896, this.inst[i], this._io, "/instances/inst") + } + } + _, err = this._io.Seek(_pos, io.SeekStart) + if err != nil { + return nil, err + } + this._f_inst = true + this._f_inst = true + return this.inst, nil +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_max_int.go b/compiled/go/src/test_formats/valid_fail_repeat_max_int.go new file mode 100644 index 000000000..f2c45c31a --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_max_int.go @@ -0,0 +1,45 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + +type ValidFailRepeatMaxInt struct { + Foo []uint8 + _io *kaitai.Stream + _root *ValidFailRepeatMaxInt + _parent kaitai.Struct +} +func NewValidFailRepeatMaxInt() *ValidFailRepeatMaxInt { + return &ValidFailRepeatMaxInt{ + } +} + +func (this ValidFailRepeatMaxInt) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatMaxInt) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatMaxInt) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadU1() + if err != nil { + return err + } + this.Foo = append(this.Foo, tmp2) + if !(this.Foo[i] <= 254) { + return kaitai.NewValidationGreaterThanError(254, this.Foo[i], this._io, "/seq/0") + } + } + return err +} diff --git a/compiled/go/src/test_formats/valid_fail_repeat_min_int.go b/compiled/go/src/test_formats/valid_fail_repeat_min_int.go new file mode 100644 index 000000000..612791158 --- /dev/null +++ b/compiled/go/src/test_formats/valid_fail_repeat_min_int.go @@ -0,0 +1,45 @@ +// Code generated by kaitai-struct-compiler from a .ksy source file. DO NOT EDIT. + +package test_formats + +import "github.com/kaitai-io/kaitai_struct_go_runtime/kaitai" + +type ValidFailRepeatMinInt struct { + Foo []int8 + _io *kaitai.Stream + _root *ValidFailRepeatMinInt + _parent kaitai.Struct +} +func NewValidFailRepeatMinInt() *ValidFailRepeatMinInt { + return &ValidFailRepeatMinInt{ + } +} + +func (this ValidFailRepeatMinInt) IO_() *kaitai.Stream { + return this._io +} + +func (this *ValidFailRepeatMinInt) Read(io *kaitai.Stream, parent kaitai.Struct, root *ValidFailRepeatMinInt) (err error) { + this._io = io + this._parent = parent + this._root = root + + for i := 0;; i++ { + tmp1, err := this._io.EOF() + if err != nil { + return err + } + if tmp1 { + break + } + tmp2, err := this._io.ReadS1() + if err != nil { + return err + } + this.Foo = append(this.Foo, tmp2) + if !(this.Foo[i] >= 0) { + return kaitai.NewValidationLessThanError(0, this.Foo[i], this._io, "/seq/0") + } + } + return err +} diff --git a/compiled/graphviz/expr_array.dot b/compiled/graphviz/expr_array.dot index 51639ba34..7fb85045c 100644 --- a/compiled/graphviz/expr_array.dot +++ b/compiled/graphviz/expr_array.dot @@ -11,7 +11,7 @@ digraph { repeat 4 times 168f8leafloat repeat 3 times - 40...str(UTF-8)astr + 40...str(term=0, UTF-8)astr repeat 3 times >]; expr_array__inst__afloat_first [label=< diff --git a/compiled/graphviz/expr_io_pos.dot b/compiled/graphviz/expr_io_pos.dot index b53f7b928..f6d1ee32d 100644 --- a/compiled/graphviz/expr_io_pos.dot +++ b/compiled/graphviz/expr_io_pos.dot @@ -16,7 +16,7 @@ digraph { all_plus_number__seq [label=<
- +
possizetypeid
0...str(UTF-8)my_str
0...str(term=0, UTF-8)my_str
...(_io.size - _io.pos) - 2body
...2u2lenumber
>]; diff --git a/compiled/graphviz/instance_io_user.dot b/compiled/graphviz/instance_io_user.dot index 94e3167c4..7b2109b08 100644 --- a/compiled/graphviz/instance_io_user.dot +++ b/compiled/graphviz/instance_io_user.dot @@ -23,7 +23,7 @@ digraph { >]; entry__inst__name [label=< - +
possizetypeid
name_ofs...str(UTF-8)name
name_ofs...str(term=0, UTF-8)name
>]; } subgraph cluster__strings_obj { @@ -32,7 +32,7 @@ digraph { strings_obj__seq [label=< - +
possizetypeid
0...str(UTF-8)str
0...str(term=0, UTF-8)str
repeat to end of stream
>]; } diff --git a/compiled/graphviz/position_abs.dot b/compiled/graphviz/position_abs.dot index 1504b2cc5..814137095 100644 --- a/compiled/graphviz/position_abs.dot +++ b/compiled/graphviz/position_abs.dot @@ -19,7 +19,7 @@ digraph { index_obj__seq [label=< - +
possizetypeid
0...str(UTF-8)entry
0...str(term=0, UTF-8)entry
>]; } } diff --git a/compiled/graphviz/repeat_n_strz.dot b/compiled/graphviz/repeat_n_strz.dot index e96e9564b..6089f2246 100644 --- a/compiled/graphviz/repeat_n_strz.dot +++ b/compiled/graphviz/repeat_n_strz.dot @@ -8,7 +8,7 @@ digraph { repeat_n_strz__seq [label=< - +
possizetypeid
04u4leqty
4...str(UTF-8)lines
4...str(term=0, UTF-8)lines
repeat qty times
>]; } diff --git a/compiled/graphviz/repeat_n_strz_double.dot b/compiled/graphviz/repeat_n_strz_double.dot index 8fbad50dd..7ce3ddfc0 100644 --- a/compiled/graphviz/repeat_n_strz_double.dot +++ b/compiled/graphviz/repeat_n_strz_double.dot @@ -8,9 +8,9 @@ digraph { repeat_n_strz_double__seq [label=< - + - +
possizetypeid
04u4leqty
4...str(UTF-8)lines1
4...str(term=0, UTF-8)lines1
repeat qty / 2 times
......str(UTF-8)lines2
......str(term=0, UTF-8)lines2
repeat qty / 2 times
>]; } diff --git a/compiled/graphviz/repeat_until_s4.dot b/compiled/graphviz/repeat_until_s4.dot index b87f6e31c..43701451d 100644 --- a/compiled/graphviz/repeat_until_s4.dot +++ b/compiled/graphviz/repeat_until_s4.dot @@ -9,7 +9,7 @@ digraph { possizetypeid 04s4leentries repeat until _ == -1 - ......str(ASCII)afterall + ......str(term=0, ASCII)afterall >]; } } diff --git a/compiled/graphviz/str_pad_term_utf16.dot b/compiled/graphviz/str_pad_term_utf16.dot new file mode 100644 index 000000000..54f9d5ca0 --- /dev/null +++ b/compiled/graphviz/str_pad_term_utf16.dot @@ -0,0 +1,15 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__str_pad_term_utf16 { + label="StrPadTermUtf16"; + graph[style=dotted]; + + str_pad_term_utf16__seq [label=< + + + + +
possizetypeid
010str(UTF-16LE)str_term
1010str(UTF-16LE)str_term_include
209str(UTF-16LE)str_term_and_pad
>]; + } +} diff --git a/compiled/graphviz/switch_bytearray.dot b/compiled/graphviz/switch_bytearray.dot index 5bdb7ac7c..0b2823f32 100644 --- a/compiled/graphviz/switch_bytearray.dot +++ b/compiled/graphviz/switch_bytearray.dot @@ -39,7 +39,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_enum.dot b/compiled/graphviz/switch_manual_enum.dot index e68047b98..c94a7c621 100644 --- a/compiled/graphviz/switch_manual_enum.dot +++ b/compiled/graphviz/switch_manual_enum.dot @@ -39,7 +39,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_enum_invalid.dot b/compiled/graphviz/switch_manual_enum_invalid.dot index 40f2039ec..dc90601b1 100644 --- a/compiled/graphviz/switch_manual_enum_invalid.dot +++ b/compiled/graphviz/switch_manual_enum_invalid.dot @@ -39,7 +39,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_enum_invalid_else.dot b/compiled/graphviz/switch_manual_enum_invalid_else.dot index 9a99574ba..31daed444 100644 --- a/compiled/graphviz/switch_manual_enum_invalid_else.dot +++ b/compiled/graphviz/switch_manual_enum_invalid_else.dot @@ -52,7 +52,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_int.dot b/compiled/graphviz/switch_manual_int.dot index bbbb7e9b1..5888c0f95 100644 --- a/compiled/graphviz/switch_manual_int.dot +++ b/compiled/graphviz/switch_manual_int.dot @@ -39,7 +39,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_int_else.dot b/compiled/graphviz/switch_manual_int_else.dot index 6d91a0b03..48b6ed9dc 100644 --- a/compiled/graphviz/switch_manual_int_else.dot +++ b/compiled/graphviz/switch_manual_int_else.dot @@ -49,7 +49,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_int_size.dot b/compiled/graphviz/switch_manual_int_size.dot index df72800aa..f7077f732 100644 --- a/compiled/graphviz/switch_manual_int_size.dot +++ b/compiled/graphviz/switch_manual_int_size.dot @@ -41,8 +41,8 @@ chunk__seq_body_switch [label=< chunk_meta__seq [label=<
- - + +
possizetypeid
0...str(UTF-8)title
......str(UTF-8)author
0...str(term=0, UTF-8)title
......str(term=0, UTF-8)author
>]; } } diff --git a/compiled/graphviz/switch_manual_int_size_else.dot b/compiled/graphviz/switch_manual_int_size_else.dot index 60bfb1e95..5ff6589af 100644 --- a/compiled/graphviz/switch_manual_int_size_else.dot +++ b/compiled/graphviz/switch_manual_int_size_else.dot @@ -42,8 +42,8 @@ chunk__seq_body_switch [label=< chunk_meta__seq [label=<
- - + +
possizetypeid
0...str(UTF-8)title
......str(UTF-8)author
0...str(term=0, UTF-8)title
......str(term=0, UTF-8)author
>]; } subgraph cluster__dummy { diff --git a/compiled/graphviz/switch_manual_int_size_eos.dot b/compiled/graphviz/switch_manual_int_size_eos.dot index 3c64efda6..d6cd622e7 100644 --- a/compiled/graphviz/switch_manual_int_size_eos.dot +++ b/compiled/graphviz/switch_manual_int_size_eos.dot @@ -50,8 +50,8 @@ chunk_body__seq_body_switch [label=< - - + +
possizetypeid
0...str(UTF-8)title
......str(UTF-8)author
0...str(term=0, UTF-8)title
......str(term=0, UTF-8)author
>]; } } diff --git a/compiled/graphviz/switch_manual_str.dot b/compiled/graphviz/switch_manual_str.dot index 7865dd79a..f1305c320 100644 --- a/compiled/graphviz/switch_manual_str.dot +++ b/compiled/graphviz/switch_manual_str.dot @@ -39,7 +39,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/switch_manual_str_else.dot b/compiled/graphviz/switch_manual_str_else.dot index 27e8b37ca..5fe974dad 100644 --- a/compiled/graphviz/switch_manual_str_else.dot +++ b/compiled/graphviz/switch_manual_str_else.dot @@ -49,7 +49,7 @@ opcode__seq_body_switch [label=< - +
possizetypeid
0...str(ASCII)value
0...str(term=0, ASCII)value
>]; } } diff --git a/compiled/graphviz/term_strz_utf16_v1.dot b/compiled/graphviz/term_strz_utf16_v1.dot new file mode 100644 index 000000000..f58859ed5 --- /dev/null +++ b/compiled/graphviz/term_strz_utf16_v1.dot @@ -0,0 +1,16 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__term_strz_utf16_v1 { + label="TermStrzUtf16V1"; + graph[style=dotted]; + + term_strz_utf16_v1__seq [label=< + + + + + +
possizetypeid
0...str(term=[0, 0], UTF-16LE)s1
......str(term=[0, 0], don't consume, UTF-16LE)s2
...2u2leterm
......str(term=[0, 0], include, UTF-16LE)s3
>]; + } +} diff --git a/compiled/graphviz/term_strz_utf16_v2.dot b/compiled/graphviz/term_strz_utf16_v2.dot new file mode 100644 index 000000000..bd7030997 --- /dev/null +++ b/compiled/graphviz/term_strz_utf16_v2.dot @@ -0,0 +1,15 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__term_strz_utf16_v2 { + label="TermStrzUtf16V2"; + graph[style=dotted]; + + term_strz_utf16_v2__seq [label=< + + + + +
possizetypeid
0...str(term=[0, 0], UTF-16LE)s1
......str(term=[0, 0], include, UTF-16LE)s2
......str(term=[0, 0], don't consume, UTF-16LE)s3
>]; + } +} diff --git a/compiled/graphviz/term_strz_utf16_v3.dot b/compiled/graphviz/term_strz_utf16_v3.dot new file mode 100644 index 000000000..5f7d12d51 --- /dev/null +++ b/compiled/graphviz/term_strz_utf16_v3.dot @@ -0,0 +1,16 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__term_strz_utf16_v3 { + label="TermStrzUtf16V3"; + graph[style=dotted]; + + term_strz_utf16_v3__seq [label=< + + + + + +
possizetypeid
0...str(term=[0, 0], don't consume, UTF-16LE)s1
...2u2leterm
......str(term=[0, 0], don't consume, UTF-16LE)s2
......str(term=[0, 0], UTF-16LE)s3
>]; + } +} diff --git a/compiled/graphviz/term_strz_utf16_v4.dot b/compiled/graphviz/term_strz_utf16_v4.dot new file mode 100644 index 000000000..4faeca33d --- /dev/null +++ b/compiled/graphviz/term_strz_utf16_v4.dot @@ -0,0 +1,47 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__term_strz_utf16_v4 { + label="TermStrzUtf16V4"; + graph[style=dotted]; + + term_strz_utf16_v4__seq [label=< + + + + + + +
possizetypeid
06S1Types1
62skip_term1
86S2Types2
142skip_term2
166S3Types3
>]; + subgraph cluster__s1_type { + label="TermStrzUtf16V4::S1Type"; + graph[style=dotted]; + + s1_type__seq [label=< + + +
possizetypeid
0...str(term=[0, 0], ignore EOS, UTF-16LE)value
>]; + } + subgraph cluster__s2_type { + label="TermStrzUtf16V4::S2Type"; + graph[style=dotted]; + + s2_type__seq [label=< + + +
possizetypeid
0...str(term=[0, 0], don't consume, ignore EOS, UTF-16LE)value
>]; + } + subgraph cluster__s3_type { + label="TermStrzUtf16V4::S3Type"; + graph[style=dotted]; + + s3_type__seq [label=< + + +
possizetypeid
0...str(term=[0, 0], include, ignore EOS, UTF-16LE)value
>]; + } + } + term_strz_utf16_v4__seq:s1_type -> s1_type__seq [style=bold]; + term_strz_utf16_v4__seq:s2_type -> s2_type__seq [style=bold]; + term_strz_utf16_v4__seq:s3_type -> s3_type__seq [style=bold]; +} diff --git a/compiled/graphviz/valid_fail_repeat_anyof_int.dot b/compiled/graphviz/valid_fail_repeat_anyof_int.dot new file mode 100644 index 000000000..816d9aeb1 --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_anyof_int.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_anyof_int { + label="ValidFailRepeatAnyofInt"; + graph[style=dotted]; + + valid_fail_repeat_anyof_int__seq [label=< + + + +
possizetypeid
01u1foo
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_contents.dot b/compiled/graphviz/valid_fail_repeat_contents.dot new file mode 100644 index 000000000..6d0f8eb4e --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_contents.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_contents { + label="ValidFailRepeatContents"; + graph[style=dotted]; + + valid_fail_repeat_contents__seq [label=< + + + +
possizetypeid
04foo
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_eq_int.dot b/compiled/graphviz/valid_fail_repeat_eq_int.dot new file mode 100644 index 000000000..42ce844e4 --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_eq_int.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_eq_int { + label="ValidFailRepeatEqInt"; + graph[style=dotted]; + + valid_fail_repeat_eq_int__seq [label=< + + + +
possizetypeid
04u4befoo
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_expr.dot b/compiled/graphviz/valid_fail_repeat_expr.dot new file mode 100644 index 000000000..4c35e5b54 --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_expr.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_expr { + label="ValidFailRepeatExpr"; + graph[style=dotted]; + + valid_fail_repeat_expr__seq [label=< + + + +
possizetypeid
04foo
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_inst.dot b/compiled/graphviz/valid_fail_repeat_inst.dot new file mode 100644 index 000000000..b2c0def3c --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_inst.dot @@ -0,0 +1,18 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_inst { + label="ValidFailRepeatInst"; + graph[style=dotted]; + + valid_fail_repeat_inst__seq [label=< + + +
possizetypeid
00a
>]; + valid_fail_repeat_inst__inst__inst [label=< + + + +
possizetypeid
04u4beinst
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_max_int.dot b/compiled/graphviz/valid_fail_repeat_max_int.dot new file mode 100644 index 000000000..921aae59b --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_max_int.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_max_int { + label="ValidFailRepeatMaxInt"; + graph[style=dotted]; + + valid_fail_repeat_max_int__seq [label=< + + + +
possizetypeid
01u1foo
repeat to end of stream
>]; + } +} diff --git a/compiled/graphviz/valid_fail_repeat_min_int.dot b/compiled/graphviz/valid_fail_repeat_min_int.dot new file mode 100644 index 000000000..ba3a14ac2 --- /dev/null +++ b/compiled/graphviz/valid_fail_repeat_min_int.dot @@ -0,0 +1,14 @@ +digraph { + rankdir=LR; + node [shape=plaintext]; + subgraph cluster__valid_fail_repeat_min_int { + label="ValidFailRepeatMinInt"; + graph[style=dotted]; + + valid_fail_repeat_min_int__seq [label=< + + + +
possizetypeid
01s1foo
repeat to end of stream
>]; + } +} diff --git a/compiled/html/cast_nested.html b/compiled/html/cast_nested.html index 9e60d3059..50818da1d 100644 --- a/compiled/html/cast_nested.html +++ b/compiled/html/cast_nested.html @@ -30,7 +30,7 @@

Type: CastNested

value instance: ValueInstanceSpec(InstanceIdentifier(opcodes_0_str),List(instances, opcodes_0_str),CastToType(Attribute(Subscript(Name(identifier(opcodes)),IntNum(0)),identifier(body)),typeId(false,List(opcode, strval),false)),None,Some(CalcUserType(List(cast_nested, opcode, strval),None,List(),false)),DocSpec(None,List())) -value instance: ValueInstanceSpec(InstanceIdentifier(opcodes_0_str_value),List(instances, opcodes_0_str_value),Attribute(CastToType(Attribute(Subscript(Name(identifier(opcodes)),IntNum(0)),identifier(body)),typeId(false,List(opcode, strval),false)),identifier(value)),None,Some(StrFromBytesType(BytesTerminatedType(0,false,true,true,None),ASCII,false)),DocSpec(None,List())) +value instance: ValueInstanceSpec(InstanceIdentifier(opcodes_0_str_value),List(instances, opcodes_0_str_value),Attribute(CastToType(Attribute(Subscript(Name(identifier(opcodes)),IntNum(0)),identifier(body)),typeId(false,List(opcode, strval),false)),identifier(value)),None,Some(StrFromBytesType(BytesTerminatedType(List(0),false,true,true,None),ASCII,false)),DocSpec(None,List())) value instance: ValueInstanceSpec(InstanceIdentifier(opcodes_1_int),List(instances, opcodes_1_int),CastToType(Attribute(Subscript(Name(identifier(opcodes)),IntNum(1)),identifier(body)),typeId(false,List(opcode, intval),false)),None,Some(CalcUserType(List(cast_nested, opcode, intval),None,List(),false)),DocSpec(None,List())) value instance: ValueInstanceSpec(InstanceIdentifier(opcodes_1_int_value),List(instances, opcodes_1_int_value),Attribute(CastToType(Attribute(Subscript(Name(identifier(opcodes)),IntNum(1)),identifier(body)),typeId(false,List(opcode, intval),false)),identifier(value)),None,Some(Int1Type(false)),DocSpec(None,List())) @@ -75,7 +75,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/expr_array.html b/compiled/html/expr_array.html index 92d1f13fb..0fc87ef04 100644 --- a/compiled/html/expr_array.html +++ b/compiled/html/expr_array.html @@ -39,7 +39,7 @@

Type: ExprArray

40 ... astr -str(UTF-8) +str(term=0, UTF-8) @@ -53,10 +53,10 @@

Type: ExprArray

value instance: ValueInstanceSpec(InstanceIdentifier(aint_max),List(instances, aint_max),Attribute(Name(identifier(aint)),identifier(max)),None,Some(IntMultiType(false,Width4,Some(LittleEndian))),DocSpec(None,List())) value instance: ValueInstanceSpec(InstanceIdentifier(aint_min),List(instances, aint_min),Attribute(Name(identifier(aint)),identifier(min)),None,Some(IntMultiType(false,Width4,Some(LittleEndian))),DocSpec(None,List())) value instance: ValueInstanceSpec(InstanceIdentifier(aint_size),List(instances, aint_size),Attribute(Name(identifier(aint)),identifier(size)),None,Some(CalcIntType),DocSpec(None,List())) -value instance: ValueInstanceSpec(InstanceIdentifier(astr_first),List(instances, astr_first),Attribute(Name(identifier(astr)),identifier(first)),None,Some(StrFromBytesType(BytesTerminatedType(0,false,true,true,None),UTF-8,true)),DocSpec(None,List())) -value instance: ValueInstanceSpec(InstanceIdentifier(astr_last),List(instances, astr_last),Attribute(Name(identifier(astr)),identifier(last)),None,Some(StrFromBytesType(BytesTerminatedType(0,false,true,true,None),UTF-8,true)),DocSpec(None,List())) -value instance: ValueInstanceSpec(InstanceIdentifier(astr_max),List(instances, astr_max),Attribute(Name(identifier(astr)),identifier(max)),None,Some(StrFromBytesType(BytesTerminatedType(0,false,true,true,None),UTF-8,true)),DocSpec(None,List())) -value instance: ValueInstanceSpec(InstanceIdentifier(astr_min),List(instances, astr_min),Attribute(Name(identifier(astr)),identifier(min)),None,Some(StrFromBytesType(BytesTerminatedType(0,false,true,true,None),UTF-8,true)),DocSpec(None,List())) +value instance: ValueInstanceSpec(InstanceIdentifier(astr_first),List(instances, astr_first),Attribute(Name(identifier(astr)),identifier(first)),None,Some(StrFromBytesType(BytesTerminatedType(List(0),false,true,true,None),UTF-8,true)),DocSpec(None,List())) +value instance: ValueInstanceSpec(InstanceIdentifier(astr_last),List(instances, astr_last),Attribute(Name(identifier(astr)),identifier(last)),None,Some(StrFromBytesType(BytesTerminatedType(List(0),false,true,true,None),UTF-8,true)),DocSpec(None,List())) +value instance: ValueInstanceSpec(InstanceIdentifier(astr_max),List(instances, astr_max),Attribute(Name(identifier(astr)),identifier(max)),None,Some(StrFromBytesType(BytesTerminatedType(List(0),false,true,true,None),UTF-8,true)),DocSpec(None,List())) +value instance: ValueInstanceSpec(InstanceIdentifier(astr_min),List(instances, astr_min),Attribute(Name(identifier(astr)),identifier(min)),None,Some(StrFromBytesType(BytesTerminatedType(List(0),false,true,true,None),UTF-8,true)),DocSpec(None,List())) value instance: ValueInstanceSpec(InstanceIdentifier(astr_size),List(instances, astr_size),Attribute(Name(identifier(astr)),identifier(size)),None,Some(CalcIntType),DocSpec(None,List())) diff --git a/compiled/html/expr_io_pos.html b/compiled/html/expr_io_pos.html index e01786d92..8c519e516 100644 --- a/compiled/html/expr_io_pos.html +++ b/compiled/html/expr_io_pos.html @@ -45,7 +45,7 @@

Type: AllPlusNumber

0 ... my_str -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/instance_io_user.html b/compiled/html/instance_io_user.html index 8a9975557..691937ad0 100644 --- a/compiled/html/instance_io_user.html +++ b/compiled/html/instance_io_user.html @@ -69,7 +69,7 @@

Type: Entry

name_ofs ... name -str(UTF-8) +str(term=0, UTF-8) @@ -82,7 +82,7 @@

Type: StringsObj

0 ... str -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/position_abs.html b/compiled/html/position_abs.html index ad80285fc..99f5965a1 100644 --- a/compiled/html/position_abs.html +++ b/compiled/html/position_abs.html @@ -48,7 +48,7 @@

Type: IndexObj

0 ... entry -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/repeat_n_strz.html b/compiled/html/repeat_n_strz.html index e93f9ef6c..64018b6cb 100644 --- a/compiled/html/repeat_n_strz.html +++ b/compiled/html/repeat_n_strz.html @@ -32,7 +32,7 @@

Type: RepeatNStrz

4 ... lines -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/repeat_n_strz_double.html b/compiled/html/repeat_n_strz_double.html index f231d5e35..da6cb23f2 100644 --- a/compiled/html/repeat_n_strz_double.html +++ b/compiled/html/repeat_n_strz_double.html @@ -32,14 +32,14 @@

Type: RepeatNStrzDouble

4 ... lines1 -str(UTF-8) +str(term=0, UTF-8) ??? ... lines2 -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/repeat_until_s4.html b/compiled/html/repeat_until_s4.html index 0c8a087a0..94c1ad4db 100644 --- a/compiled/html/repeat_until_s4.html +++ b/compiled/html/repeat_until_s4.html @@ -32,7 +32,7 @@

Type: RepeatUntilS4

??? ... afterall -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/str_pad_term_utf16.html b/compiled/html/str_pad_term_utf16.html new file mode 100644 index 000000000..d312eb9d1 --- /dev/null +++ b/compiled/html/str_pad_term_utf16.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + StrPadTermUtf16 format specification + + +
+

StrPadTermUtf16 format specification

+ + + +

Type: StrPadTermUtf16

+ + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeIDTypeNote
0...str_termstr(UTF-16LE)
10...str_term_includestr(UTF-16LE)
20...str_term_and_padstr(UTF-16LE)
+ +
+ + + + + + + + diff --git a/compiled/html/switch_bytearray.html b/compiled/html/switch_bytearray.html index 2f0449839..a7a204fbe 100644 --- a/compiled/html/switch_bytearray.html +++ b/compiled/html/switch_bytearray.html @@ -71,7 +71,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_cast.html b/compiled/html/switch_cast.html index 77ad36a5a..e3fb4bc58 100644 --- a/compiled/html/switch_cast.html +++ b/compiled/html/switch_cast.html @@ -74,7 +74,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_enum.html b/compiled/html/switch_manual_enum.html index 83583e394..8394bbcd0 100644 --- a/compiled/html/switch_manual_enum.html +++ b/compiled/html/switch_manual_enum.html @@ -85,7 +85,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_enum_invalid.html b/compiled/html/switch_manual_enum_invalid.html index 725c88764..af7c931a5 100644 --- a/compiled/html/switch_manual_enum_invalid.html +++ b/compiled/html/switch_manual_enum_invalid.html @@ -85,7 +85,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_enum_invalid_else.html b/compiled/html/switch_manual_enum_invalid_else.html index 70bf68903..90c614585 100644 --- a/compiled/html/switch_manual_enum_invalid_else.html +++ b/compiled/html/switch_manual_enum_invalid_else.html @@ -92,7 +92,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_int.html b/compiled/html/switch_manual_int.html index 036477a9d..f7f45b646 100644 --- a/compiled/html/switch_manual_int.html +++ b/compiled/html/switch_manual_int.html @@ -71,7 +71,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_int_else.html b/compiled/html/switch_manual_int_else.html index bd3830704..82ec3fac8 100644 --- a/compiled/html/switch_manual_int_else.html +++ b/compiled/html/switch_manual_int_else.html @@ -84,7 +84,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_int_size.html b/compiled/html/switch_manual_int_size.html index 9ca54e160..57cad3c05 100644 --- a/compiled/html/switch_manual_int_size.html +++ b/compiled/html/switch_manual_int_size.html @@ -78,14 +78,14 @@

Type: ChunkMeta

0 ... title -str(UTF-8) +str(term=0, UTF-8) ??? ... author -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/switch_manual_int_size_else.html b/compiled/html/switch_manual_int_size_else.html index b979881fd..e52ec79b0 100644 --- a/compiled/html/switch_manual_int_size_else.html +++ b/compiled/html/switch_manual_int_size_else.html @@ -78,14 +78,14 @@

Type: ChunkMeta

0 ... title -str(UTF-8) +str(term=0, UTF-8) ??? ... author -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/switch_manual_int_size_eos.html b/compiled/html/switch_manual_int_size_eos.html index 1aa65d610..fb21f5289 100644 --- a/compiled/html/switch_manual_int_size_eos.html +++ b/compiled/html/switch_manual_int_size_eos.html @@ -91,14 +91,14 @@

Type: ChunkMeta

0 ... title -str(UTF-8) +str(term=0, UTF-8) ??? ... author -str(UTF-8) +str(term=0, UTF-8) diff --git a/compiled/html/switch_manual_str.html b/compiled/html/switch_manual_str.html index 4e66dfb87..99a5e5b18 100644 --- a/compiled/html/switch_manual_str.html +++ b/compiled/html/switch_manual_str.html @@ -71,7 +71,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/switch_manual_str_else.html b/compiled/html/switch_manual_str_else.html index cd865386d..6ccca5bbf 100644 --- a/compiled/html/switch_manual_str_else.html +++ b/compiled/html/switch_manual_str_else.html @@ -84,7 +84,7 @@

Type: Strval

0 ... value -str(ASCII) +str(term=0, ASCII) diff --git a/compiled/html/term_strz_utf16_v1.html b/compiled/html/term_strz_utf16_v1.html new file mode 100644 index 000000000..4487633a3 --- /dev/null +++ b/compiled/html/term_strz_utf16_v1.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + TermStrzUtf16V1 format specification + + +
+

TermStrzUtf16V1 format specification

+ + + +

Type: TermStrzUtf16V1

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeIDTypeNote
0...s1str(term=[0, 0], UTF-16LE)
???...s2str(term=[0, 0], don't consume, UTF-16LE)
???...termu2le
???...s3str(term=[0, 0], include, UTF-16LE)
+ +
+ + + + + + + + diff --git a/compiled/html/term_strz_utf16_v2.html b/compiled/html/term_strz_utf16_v2.html new file mode 100644 index 000000000..e9bf7cac2 --- /dev/null +++ b/compiled/html/term_strz_utf16_v2.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + TermStrzUtf16V2 format specification + + +
+

TermStrzUtf16V2 format specification

+ + + +

Type: TermStrzUtf16V2

+ + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeIDTypeNote
0...s1str(term=[0, 0], UTF-16LE)
???...s2str(term=[0, 0], include, UTF-16LE)
???...s3str(term=[0, 0], don't consume, UTF-16LE)
+ +
+ + + + + + + + diff --git a/compiled/html/term_strz_utf16_v3.html b/compiled/html/term_strz_utf16_v3.html new file mode 100644 index 000000000..023aa9665 --- /dev/null +++ b/compiled/html/term_strz_utf16_v3.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + TermStrzUtf16V3 format specification + + +
+

TermStrzUtf16V3 format specification

+ + + +

Type: TermStrzUtf16V3

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeIDTypeNote
0...s1str(term=[0, 0], don't consume, UTF-16LE)
???...termu2le
???...s2str(term=[0, 0], don't consume, UTF-16LE)
???...s3str(term=[0, 0], UTF-16LE)
+ +
+ + + + + + + + diff --git a/compiled/html/term_strz_utf16_v4.html b/compiled/html/term_strz_utf16_v4.html new file mode 100644 index 000000000..22b4eede6 --- /dev/null +++ b/compiled/html/term_strz_utf16_v4.html @@ -0,0 +1,108 @@ + + + + + + + + + + + + TermStrzUtf16V4 format specification + + +
+

TermStrzUtf16V4 format specification

+ + + +

Type: TermStrzUtf16V4

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetSizeIDTypeNote
0...s1S1Type
6...skip_term1
8...s2S2Type
14...skip_term2
16...s3S3Type
+ +

Type: S1Type

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...valuestr(term=[0, 0], ignore EOS, UTF-16LE)
+ +

Type: S2Type

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...valuestr(term=[0, 0], don't consume, ignore EOS, UTF-16LE)
+ +

Type: S3Type

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...valuestr(term=[0, 0], include, ignore EOS, UTF-16LE)
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_anyof_int.html b/compiled/html/valid_fail_repeat_anyof_int.html new file mode 100644 index 000000000..19d025693 --- /dev/null +++ b/compiled/html/valid_fail_repeat_anyof_int.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatAnyofInt format specification + + +
+

ValidFailRepeatAnyofInt format specification

+ + + +

Type: ValidFailRepeatAnyofInt

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foou1
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_contents.html b/compiled/html/valid_fail_repeat_contents.html new file mode 100644 index 000000000..042622596 --- /dev/null +++ b/compiled/html/valid_fail_repeat_contents.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatContents format specification + + +
+

ValidFailRepeatContents format specification

+ + + +

Type: ValidFailRepeatContents

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foo
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_eq_int.html b/compiled/html/valid_fail_repeat_eq_int.html new file mode 100644 index 000000000..1d81eab37 --- /dev/null +++ b/compiled/html/valid_fail_repeat_eq_int.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatEqInt format specification + + +
+

ValidFailRepeatEqInt format specification

+ + + +

Type: ValidFailRepeatEqInt

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foou4be
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_expr.html b/compiled/html/valid_fail_repeat_expr.html new file mode 100644 index 000000000..06d4d0b0b --- /dev/null +++ b/compiled/html/valid_fail_repeat_expr.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatExpr format specification + + +
+

ValidFailRepeatExpr format specification

+ + + +

Type: ValidFailRepeatExpr

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foo
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_inst.html b/compiled/html/valid_fail_repeat_inst.html new file mode 100644 index 000000000..4d456c210 --- /dev/null +++ b/compiled/html/valid_fail_repeat_inst.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + ValidFailRepeatInst format specification + + +
+

ValidFailRepeatInst format specification

+ + + +

Type: ValidFailRepeatInst

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...a
+

Parse instance: inst

+ + + + + + + + +
0...instu4be
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_max_int.html b/compiled/html/valid_fail_repeat_max_int.html new file mode 100644 index 000000000..2d95c34fa --- /dev/null +++ b/compiled/html/valid_fail_repeat_max_int.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatMaxInt format specification + + +
+

ValidFailRepeatMaxInt format specification

+ + + +

Type: ValidFailRepeatMaxInt

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foou1
+ +
+ + + + + + + + diff --git a/compiled/html/valid_fail_repeat_min_int.html b/compiled/html/valid_fail_repeat_min_int.html new file mode 100644 index 000000000..5701d740c --- /dev/null +++ b/compiled/html/valid_fail_repeat_min_int.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + ValidFailRepeatMinInt format specification + + +
+

ValidFailRepeatMinInt format specification

+ + + +

Type: ValidFailRepeatMinInt

+ + + + + + + + + + +
OffsetSizeIDTypeNote
0...foos1
+ +
+ + + + + + + + diff --git a/compiled/java/src/io/kaitai/struct/testformats/FixedContents.java b/compiled/java/src/io/kaitai/struct/testformats/FixedContents.java index 9a841ddae..2c7f55a19 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/FixedContents.java +++ b/compiled/java/src/io/kaitai/struct/testformats/FixedContents.java @@ -29,12 +29,12 @@ public FixedContents(KaitaiStream _io, KaitaiStruct _parent, FixedContents _root } private void _read() { this.normal = this._io.readBytes(6); - if (!(Arrays.equals(normal(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, normal(), _io(), "/seq/0"); + if (!(Arrays.equals(this.normal, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this.normal, this._io, "/seq/0"); } this.highBit8 = this._io.readBytes(2); - if (!(Arrays.equals(highBit8(), new byte[] { -1, -1 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { -1, -1 }, highBit8(), _io(), "/seq/1"); + if (!(Arrays.equals(this.highBit8, new byte[] { -1, -1 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { -1, -1 }, this.highBit8, this._io, "/seq/1"); } } private byte[] normal; diff --git a/compiled/java/src/io/kaitai/struct/testformats/FixedStruct.java b/compiled/java/src/io/kaitai/struct/testformats/FixedStruct.java index 5afe9673d..abce0575f 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/FixedStruct.java +++ b/compiled/java/src/io/kaitai/struct/testformats/FixedStruct.java @@ -50,49 +50,49 @@ public Header(KaitaiStream _io, FixedStruct _parent, FixedStruct _root) { } private void _read() { this.magic1 = this._io.readBytes(6); - if (!(Arrays.equals(magic1(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, magic1(), _io(), "/types/header/seq/0"); + if (!(Arrays.equals(this.magic1, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this.magic1, this._io, "/types/header/seq/0"); } this.uint8 = this._io.readU1(); this.sint8 = this._io.readS1(); this.magicUint = this._io.readBytes(10); - if (!(Arrays.equals(magicUint(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, magicUint(), _io(), "/types/header/seq/3"); + if (!(Arrays.equals(this.magicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, this.magicUint, this._io, "/types/header/seq/3"); } this.uint16 = this._io.readU2le(); this.uint32 = this._io.readU4le(); this.uint64 = this._io.readU8le(); this.magicSint = this._io.readBytes(10); - if (!(Arrays.equals(magicSint(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, magicSint(), _io(), "/types/header/seq/7"); + if (!(Arrays.equals(this.magicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, this.magicSint, this._io, "/types/header/seq/7"); } this.sint16 = this._io.readS2le(); this.sint32 = this._io.readS4le(); this.sint64 = this._io.readS8le(); this.magicUintLe = this._io.readBytes(9); - if (!(Arrays.equals(magicUintLe(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, magicUintLe(), _io(), "/types/header/seq/11"); + if (!(Arrays.equals(this.magicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, this.magicUintLe, this._io, "/types/header/seq/11"); } this.uint16le = this._io.readU2le(); this.uint32le = this._io.readU4le(); this.uint64le = this._io.readU8le(); this.magicSintLe = this._io.readBytes(9); - if (!(Arrays.equals(magicSintLe(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, magicSintLe(), _io(), "/types/header/seq/15"); + if (!(Arrays.equals(this.magicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, this.magicSintLe, this._io, "/types/header/seq/15"); } this.sint16le = this._io.readS2le(); this.sint32le = this._io.readS4le(); this.sint64le = this._io.readS8le(); this.magicUintBe = this._io.readBytes(9); - if (!(Arrays.equals(magicUintBe(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, magicUintBe(), _io(), "/types/header/seq/19"); + if (!(Arrays.equals(this.magicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, this.magicUintBe, this._io, "/types/header/seq/19"); } this.uint16be = this._io.readU2be(); this.uint32be = this._io.readU4be(); this.uint64be = this._io.readU8be(); this.magicSintBe = this._io.readBytes(9); - if (!(Arrays.equals(magicSintBe(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, magicSintBe(), _io(), "/types/header/seq/23"); + if (!(Arrays.equals(this.magicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, this.magicSintBe, this._io, "/types/header/seq/23"); } this.sint16be = this._io.readS2be(); this.sint32be = this._io.readS4be(); diff --git a/compiled/java/src/io/kaitai/struct/testformats/Integers.java b/compiled/java/src/io/kaitai/struct/testformats/Integers.java index 8824f1fe9..34d328924 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/Integers.java +++ b/compiled/java/src/io/kaitai/struct/testformats/Integers.java @@ -29,49 +29,49 @@ public Integers(KaitaiStream _io, KaitaiStruct _parent, Integers _root) { } private void _read() { this.magic1 = this._io.readBytes(6); - if (!(Arrays.equals(magic1(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, magic1(), _io(), "/seq/0"); + if (!(Arrays.equals(this.magic1, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this.magic1, this._io, "/seq/0"); } this.uint8 = this._io.readU1(); this.sint8 = this._io.readS1(); this.magicUint = this._io.readBytes(10); - if (!(Arrays.equals(magicUint(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, magicUint(), _io(), "/seq/3"); + if (!(Arrays.equals(this.magicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, this.magicUint, this._io, "/seq/3"); } this.uint16 = this._io.readU2le(); this.uint32 = this._io.readU4le(); this.uint64 = this._io.readU8le(); this.magicSint = this._io.readBytes(10); - if (!(Arrays.equals(magicSint(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, magicSint(), _io(), "/seq/7"); + if (!(Arrays.equals(this.magicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, this.magicSint, this._io, "/seq/7"); } this.sint16 = this._io.readS2le(); this.sint32 = this._io.readS4le(); this.sint64 = this._io.readS8le(); this.magicUintLe = this._io.readBytes(9); - if (!(Arrays.equals(magicUintLe(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, magicUintLe(), _io(), "/seq/11"); + if (!(Arrays.equals(this.magicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, this.magicUintLe, this._io, "/seq/11"); } this.uint16le = this._io.readU2le(); this.uint32le = this._io.readU4le(); this.uint64le = this._io.readU8le(); this.magicSintLe = this._io.readBytes(9); - if (!(Arrays.equals(magicSintLe(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, magicSintLe(), _io(), "/seq/15"); + if (!(Arrays.equals(this.magicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, this.magicSintLe, this._io, "/seq/15"); } this.sint16le = this._io.readS2le(); this.sint32le = this._io.readS4le(); this.sint64le = this._io.readS8le(); this.magicUintBe = this._io.readBytes(9); - if (!(Arrays.equals(magicUintBe(), new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, magicUintBe(), _io(), "/seq/19"); + if (!(Arrays.equals(this.magicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, this.magicUintBe, this._io, "/seq/19"); } this.uint16be = this._io.readU2be(); this.uint32be = this._io.readU4be(); this.uint64be = this._io.readU8be(); this.magicSintBe = this._io.readBytes(9); - if (!(Arrays.equals(magicSintBe(), new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, magicSintBe(), _io(), "/seq/23"); + if (!(Arrays.equals(this.magicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, this.magicSintBe, this._io, "/seq/23"); } this.sint16be = this._io.readS2be(); this.sint32be = this._io.readS4be(); diff --git a/compiled/java/src/io/kaitai/struct/testformats/StrPadTermUtf16.java b/compiled/java/src/io/kaitai/struct/testformats/StrPadTermUtf16.java new file mode 100644 index 000000000..f80242eb1 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/StrPadTermUtf16.java @@ -0,0 +1,45 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class StrPadTermUtf16 extends KaitaiStruct { + public static StrPadTermUtf16 fromFile(String fileName) throws IOException { + return new StrPadTermUtf16(new ByteBufferKaitaiStream(fileName)); + } + + public StrPadTermUtf16(KaitaiStream _io) { + this(_io, null, null); + } + + public StrPadTermUtf16(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public StrPadTermUtf16(KaitaiStream _io, KaitaiStruct _parent, StrPadTermUtf16 _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.strTerm = new String(KaitaiStream.bytesTerminateMulti(this._io.readBytes(10), new byte[] { 0, 0 }, false), StandardCharsets.UTF_16LE); + this.strTermInclude = new String(KaitaiStream.bytesTerminateMulti(this._io.readBytes(10), new byte[] { 0, 0 }, true), StandardCharsets.UTF_16LE); + this.strTermAndPad = new String(KaitaiStream.bytesTerminateMulti(KaitaiStream.bytesStripRight(this._io.readBytes(9), (byte) 43), new byte[] { 0, 0 }, false), StandardCharsets.UTF_16LE); + } + private String strTerm; + private String strTermInclude; + private String strTermAndPad; + private StrPadTermUtf16 _root; + private KaitaiStruct _parent; + public String strTerm() { return strTerm; } + public String strTermInclude() { return strTermInclude; } + public String strTermAndPad() { return strTermAndPad; } + public StrPadTermUtf16 _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V1.java b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V1.java new file mode 100644 index 000000000..5ed50a1ab --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V1.java @@ -0,0 +1,48 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class TermStrzUtf16V1 extends KaitaiStruct { + public static TermStrzUtf16V1 fromFile(String fileName) throws IOException { + return new TermStrzUtf16V1(new ByteBufferKaitaiStream(fileName)); + } + + public TermStrzUtf16V1(KaitaiStream _io) { + this(_io, null, null); + } + + public TermStrzUtf16V1(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public TermStrzUtf16V1(KaitaiStream _io, KaitaiStruct _parent, TermStrzUtf16V1 _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.s1 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, true, true), StandardCharsets.UTF_16LE); + this.s2 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, false, true), StandardCharsets.UTF_16LE); + this.term = this._io.readU2le(); + this.s3 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, true, true, true), StandardCharsets.UTF_16LE); + } + private String s1; + private String s2; + private int term; + private String s3; + private TermStrzUtf16V1 _root; + private KaitaiStruct _parent; + public String s1() { return s1; } + public String s2() { return s2; } + public int term() { return term; } + public String s3() { return s3; } + public TermStrzUtf16V1 _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V2.java b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V2.java new file mode 100644 index 000000000..3b2c6e820 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V2.java @@ -0,0 +1,45 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class TermStrzUtf16V2 extends KaitaiStruct { + public static TermStrzUtf16V2 fromFile(String fileName) throws IOException { + return new TermStrzUtf16V2(new ByteBufferKaitaiStream(fileName)); + } + + public TermStrzUtf16V2(KaitaiStream _io) { + this(_io, null, null); + } + + public TermStrzUtf16V2(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public TermStrzUtf16V2(KaitaiStream _io, KaitaiStruct _parent, TermStrzUtf16V2 _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.s1 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, true, true), StandardCharsets.UTF_16LE); + this.s2 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, true, true, true), StandardCharsets.UTF_16LE); + this.s3 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, false, true), StandardCharsets.UTF_16LE); + } + private String s1; + private String s2; + private String s3; + private TermStrzUtf16V2 _root; + private KaitaiStruct _parent; + public String s1() { return s1; } + public String s2() { return s2; } + public String s3() { return s3; } + public TermStrzUtf16V2 _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V3.java b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V3.java new file mode 100644 index 000000000..6c037b87f --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V3.java @@ -0,0 +1,48 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class TermStrzUtf16V3 extends KaitaiStruct { + public static TermStrzUtf16V3 fromFile(String fileName) throws IOException { + return new TermStrzUtf16V3(new ByteBufferKaitaiStream(fileName)); + } + + public TermStrzUtf16V3(KaitaiStream _io) { + this(_io, null, null); + } + + public TermStrzUtf16V3(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public TermStrzUtf16V3(KaitaiStream _io, KaitaiStruct _parent, TermStrzUtf16V3 _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.s1 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, false, true), StandardCharsets.UTF_16LE); + this.term = this._io.readU2le(); + this.s2 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, false, true), StandardCharsets.UTF_16LE); + this.s3 = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, true, true), StandardCharsets.UTF_16LE); + } + private String s1; + private int term; + private String s2; + private String s3; + private TermStrzUtf16V3 _root; + private KaitaiStruct _parent; + public String s1() { return s1; } + public int term() { return term; } + public String s2() { return s2; } + public String s3() { return s3; } + public TermStrzUtf16V3 _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V4.java b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V4.java new file mode 100644 index 000000000..bdf7cabef --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/TermStrzUtf16V4.java @@ -0,0 +1,141 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class TermStrzUtf16V4 extends KaitaiStruct { + public static TermStrzUtf16V4 fromFile(String fileName) throws IOException { + return new TermStrzUtf16V4(new ByteBufferKaitaiStream(fileName)); + } + + public TermStrzUtf16V4(KaitaiStream _io) { + this(_io, null, null); + } + + public TermStrzUtf16V4(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public TermStrzUtf16V4(KaitaiStream _io, KaitaiStruct _parent, TermStrzUtf16V4 _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + KaitaiStream _io_s1 = this._io.substream(6); + this.s1 = new S1Type(_io_s1, this, _root); + this.skipTerm1 = this._io.readBytes(2); + KaitaiStream _io_s2 = this._io.substream(6); + this.s2 = new S2Type(_io_s2, this, _root); + this.skipTerm2 = this._io.readBytes(2); + KaitaiStream _io_s3 = this._io.substream(6); + this.s3 = new S3Type(_io_s3, this, _root); + } + public static class S1Type extends KaitaiStruct { + public static S1Type fromFile(String fileName) throws IOException { + return new S1Type(new ByteBufferKaitaiStream(fileName)); + } + + public S1Type(KaitaiStream _io) { + this(_io, null, null); + } + + public S1Type(KaitaiStream _io, TermStrzUtf16V4 _parent) { + this(_io, _parent, null); + } + + public S1Type(KaitaiStream _io, TermStrzUtf16V4 _parent, TermStrzUtf16V4 _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + private void _read() { + this.value = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, true, false), StandardCharsets.UTF_16LE); + } + private String value; + private TermStrzUtf16V4 _root; + private TermStrzUtf16V4 _parent; + public String value() { return value; } + public TermStrzUtf16V4 _root() { return _root; } + public TermStrzUtf16V4 _parent() { return _parent; } + } + public static class S2Type extends KaitaiStruct { + public static S2Type fromFile(String fileName) throws IOException { + return new S2Type(new ByteBufferKaitaiStream(fileName)); + } + + public S2Type(KaitaiStream _io) { + this(_io, null, null); + } + + public S2Type(KaitaiStream _io, TermStrzUtf16V4 _parent) { + this(_io, _parent, null); + } + + public S2Type(KaitaiStream _io, TermStrzUtf16V4 _parent, TermStrzUtf16V4 _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + private void _read() { + this.value = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, false, false, false), StandardCharsets.UTF_16LE); + } + private String value; + private TermStrzUtf16V4 _root; + private TermStrzUtf16V4 _parent; + public String value() { return value; } + public TermStrzUtf16V4 _root() { return _root; } + public TermStrzUtf16V4 _parent() { return _parent; } + } + public static class S3Type extends KaitaiStruct { + public static S3Type fromFile(String fileName) throws IOException { + return new S3Type(new ByteBufferKaitaiStream(fileName)); + } + + public S3Type(KaitaiStream _io) { + this(_io, null, null); + } + + public S3Type(KaitaiStream _io, TermStrzUtf16V4 _parent) { + this(_io, _parent, null); + } + + public S3Type(KaitaiStream _io, TermStrzUtf16V4 _parent, TermStrzUtf16V4 _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + private void _read() { + this.value = new String(this._io.readBytesTermMulti(new byte[] { 0, 0 }, true, true, false), StandardCharsets.UTF_16LE); + } + private String value; + private TermStrzUtf16V4 _root; + private TermStrzUtf16V4 _parent; + public String value() { return value; } + public TermStrzUtf16V4 _root() { return _root; } + public TermStrzUtf16V4 _parent() { return _parent; } + } + private S1Type s1; + private byte[] skipTerm1; + private S2Type s2; + private byte[] skipTerm2; + private S3Type s3; + private TermStrzUtf16V4 _root; + private KaitaiStruct _parent; + public S1Type s1() { return s1; } + public byte[] skipTerm1() { return skipTerm1; } + public S2Type s2() { return s2; } + public byte[] skipTerm2() { return skipTerm2; } + public S3Type s3() { return s3; } + public TermStrzUtf16V4 _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidEqStrEncodings.java b/compiled/java/src/io/kaitai/struct/testformats/ValidEqStrEncodings.java index 89512506d..2298b60a1 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidEqStrEncodings.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidEqStrEncodings.java @@ -31,23 +31,23 @@ public ValidEqStrEncodings(KaitaiStream _io, KaitaiStruct _parent, ValidEqStrEnc private void _read() { this.lenOf1 = this._io.readU2le(); this.str1 = new String(this._io.readBytes(lenOf1()), StandardCharsets.US_ASCII); - if (!(str1().equals("Some ASCII"))) { - throw new KaitaiStream.ValidationNotEqualError("Some ASCII", str1(), _io(), "/seq/1"); + if (!(this.str1.equals("Some ASCII"))) { + throw new KaitaiStream.ValidationNotEqualError("Some ASCII", this.str1, this._io, "/seq/1"); } this.lenOf2 = this._io.readU2le(); this.str2 = new String(this._io.readBytes(lenOf2()), StandardCharsets.UTF_8); - if (!(str2().equals("\u3053\u3093\u306b\u3061\u306f"))) { - throw new KaitaiStream.ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", str2(), _io(), "/seq/3"); + if (!(this.str2.equals("\u3053\u3093\u306b\u3061\u306f"))) { + throw new KaitaiStream.ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", this.str2, this._io, "/seq/3"); } this.lenOf3 = this._io.readU2le(); this.str3 = new String(this._io.readBytes(lenOf3()), Charset.forName("SJIS")); - if (!(str3().equals("\u3053\u3093\u306b\u3061\u306f"))) { - throw new KaitaiStream.ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", str3(), _io(), "/seq/5"); + if (!(this.str3.equals("\u3053\u3093\u306b\u3061\u306f"))) { + throw new KaitaiStream.ValidationNotEqualError("\u3053\u3093\u306b\u3061\u306f", this.str3, this._io, "/seq/5"); } this.lenOf4 = this._io.readU2le(); this.str4 = new String(this._io.readBytes(lenOf4()), Charset.forName("IBM437")); - if (!(str4().equals("\u2591\u2592\u2593"))) { - throw new KaitaiStream.ValidationNotEqualError("\u2591\u2592\u2593", str4(), _io(), "/seq/7"); + if (!(this.str4.equals("\u2591\u2592\u2593"))) { + throw new KaitaiStream.ValidationNotEqualError("\u2591\u2592\u2593", this.str4, this._io, "/seq/7"); } } private int lenOf1; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailAnyofInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailAnyofInt.java index bcd12feb6..aa1b0e87c 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailAnyofInt.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailAnyofInt.java @@ -28,8 +28,8 @@ public ValidFailAnyofInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailAnyofI } private void _read() { this.foo = this._io.readU1(); - if (!( ((foo() == 5) || (foo() == 6) || (foo() == 7) || (foo() == 8) || (foo() == 10) || (foo() == 11) || (foo() == 12) || (foo() == 47)) )) { - throw new KaitaiStream.ValidationNotAnyOfError(foo(), _io(), "/seq/0"); + if (!( ((this.foo == 5) || (this.foo == 6) || (this.foo == 7) || (this.foo == 8) || (this.foo == 10) || (this.foo == 11) || (this.foo == 12) || (this.foo == 47)) )) { + throw new KaitaiStream.ValidationNotAnyOfError(this.foo, this._io, "/seq/0"); } } private int foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailContents.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailContents.java index 8ffd38637..a6c4197c1 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailContents.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailContents.java @@ -29,8 +29,8 @@ public ValidFailContents(KaitaiStream _io, KaitaiStruct _parent, ValidFailConten } private void _read() { this.foo = this._io.readBytes(2); - if (!(Arrays.equals(foo(), new byte[] { 81, 65 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 81, 65 }, foo(), _io(), "/seq/0"); + if (!(Arrays.equals(this.foo, new byte[] { 81, 65 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 81, 65 }, this.foo, this._io, "/seq/0"); } } private byte[] foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqBytes.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqBytes.java index 1dbc3bbfc..d349e08ad 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqBytes.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqBytes.java @@ -29,8 +29,8 @@ public ValidFailEqBytes(KaitaiStream _io, KaitaiStruct _parent, ValidFailEqBytes } private void _read() { this.foo = this._io.readBytes(2); - if (!(Arrays.equals(foo(), new byte[] { 81, 65 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 81, 65 }, foo(), _io(), "/seq/0"); + if (!(Arrays.equals(this.foo, new byte[] { 81, 65 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 81, 65 }, this.foo, this._io, "/seq/0"); } } private byte[] foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqInt.java index 24d7feb51..2ae143358 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqInt.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqInt.java @@ -28,8 +28,8 @@ public ValidFailEqInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailEqInt _ro } private void _read() { this.foo = this._io.readU1(); - if (!(foo() == 123)) { - throw new KaitaiStream.ValidationNotEqualError(123, foo(), _io(), "/seq/0"); + if (!(this.foo == 123)) { + throw new KaitaiStream.ValidationNotEqualError(123, this.foo, this._io, "/seq/0"); } } private int foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqStr.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqStr.java index 325c21b98..247f0540e 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqStr.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailEqStr.java @@ -29,8 +29,8 @@ public ValidFailEqStr(KaitaiStream _io, KaitaiStruct _parent, ValidFailEqStr _ro } private void _read() { this.foo = new String(this._io.readBytes(4), StandardCharsets.US_ASCII); - if (!(foo().equals("BACK"))) { - throw new KaitaiStream.ValidationNotEqualError("BACK", foo(), _io(), "/seq/0"); + if (!(this.foo.equals("BACK"))) { + throw new KaitaiStream.ValidationNotEqualError("BACK", this.foo, this._io, "/seq/0"); } } private String foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailExpr.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailExpr.java index 61f3e969a..d5b46b8e1 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailExpr.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailExpr.java @@ -29,16 +29,16 @@ public ValidFailExpr(KaitaiStream _io, KaitaiStruct _parent, ValidFailExpr _root private void _read() { this.foo = this._io.readU1(); { - int _it = foo(); + int _it = this.foo; if (!(_it == 1)) { - throw new KaitaiStream.ValidationExprError(foo(), _io(), "/seq/0"); + throw new KaitaiStream.ValidationExprError(this.foo, this._io, "/seq/0"); } } this.bar = this._io.readS2le(); { - short _it = bar(); + short _it = this.bar; if (!( ((_it < -190) || (_it > -190)) )) { - throw new KaitaiStream.ValidationExprError(bar(), _io(), "/seq/1"); + throw new KaitaiStream.ValidationExprError(this.bar, this._io, "/seq/1"); } } } diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailInst.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailInst.java index 8f96ad6a3..aa76cced7 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailInst.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailInst.java @@ -38,10 +38,10 @@ public Integer inst() { long _pos = this._io.pos(); this._io.seek(5); this.inst = this._io.readU1(); - this._io.seek(_pos); - if (!(inst() == 80)) { - throw new KaitaiStream.ValidationNotEqualError(80, inst(), _io(), "/instances/inst"); + if (!(this.inst == 80)) { + throw new KaitaiStream.ValidationNotEqualError(80, this.inst, this._io, "/instances/inst"); } + this._io.seek(_pos); return this.inst; } private Integer a; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailMaxInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailMaxInt.java index 457ca9da3..7aa2dba84 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailMaxInt.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailMaxInt.java @@ -28,8 +28,8 @@ public ValidFailMaxInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailMaxInt _ } private void _read() { this.foo = this._io.readU1(); - if (!(foo() <= 12)) { - throw new KaitaiStream.ValidationGreaterThanError(12, foo(), _io(), "/seq/0"); + if (!(this.foo <= 12)) { + throw new KaitaiStream.ValidationGreaterThanError(12, this.foo, this._io, "/seq/0"); } } private int foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailMinInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailMinInt.java index 10256462c..b44081521 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailMinInt.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailMinInt.java @@ -28,8 +28,8 @@ public ValidFailMinInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailMinInt _ } private void _read() { this.foo = this._io.readU1(); - if (!(foo() >= 123)) { - throw new KaitaiStream.ValidationLessThanError(123, foo(), _io(), "/seq/0"); + if (!(this.foo >= 123)) { + throw new KaitaiStream.ValidationLessThanError(123, this.foo, this._io, "/seq/0"); } } private int foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeBytes.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeBytes.java index bc71aa26a..50de2913e 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeBytes.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeBytes.java @@ -28,11 +28,11 @@ public ValidFailRangeBytes(KaitaiStream _io, KaitaiStruct _parent, ValidFailRang } private void _read() { this.foo = this._io.readBytes(2); - if (!((KaitaiStream.byteArrayCompare(foo(), new byte[] { 80 }) >= 0))) { - throw new KaitaiStream.ValidationLessThanError(new byte[] { 80 }, foo(), _io(), "/seq/0"); + if (!((KaitaiStream.byteArrayCompare(this.foo, new byte[] { 80 }) >= 0))) { + throw new KaitaiStream.ValidationLessThanError(new byte[] { 80 }, this.foo, this._io, "/seq/0"); } - if (!((KaitaiStream.byteArrayCompare(foo(), new byte[] { 80, 49 }) <= 0))) { - throw new KaitaiStream.ValidationGreaterThanError(new byte[] { 80, 49 }, foo(), _io(), "/seq/0"); + if (!((KaitaiStream.byteArrayCompare(this.foo, new byte[] { 80, 49 }) <= 0))) { + throw new KaitaiStream.ValidationGreaterThanError(new byte[] { 80, 49 }, this.foo, this._io, "/seq/0"); } } private byte[] foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeFloat.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeFloat.java index 3ac92027c..5fb26af0d 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeFloat.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeFloat.java @@ -28,11 +28,11 @@ public ValidFailRangeFloat(KaitaiStream _io, KaitaiStruct _parent, ValidFailRang } private void _read() { this.foo = this._io.readF4le(); - if (!(foo() >= 0.2)) { - throw new KaitaiStream.ValidationLessThanError(0.2, foo(), _io(), "/seq/0"); + if (!(this.foo >= 0.2)) { + throw new KaitaiStream.ValidationLessThanError(0.2, this.foo, this._io, "/seq/0"); } - if (!(foo() <= 0.4)) { - throw new KaitaiStream.ValidationGreaterThanError(0.4, foo(), _io(), "/seq/0"); + if (!(this.foo <= 0.4)) { + throw new KaitaiStream.ValidationGreaterThanError(0.4, this.foo, this._io, "/seq/0"); } } private float foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeInt.java index 50f72793b..d0bc30a20 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeInt.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeInt.java @@ -28,11 +28,11 @@ public ValidFailRangeInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailRangeI } private void _read() { this.foo = this._io.readU1(); - if (!(foo() >= 5)) { - throw new KaitaiStream.ValidationLessThanError(5, foo(), _io(), "/seq/0"); + if (!(this.foo >= 5)) { + throw new KaitaiStream.ValidationLessThanError(5, this.foo, this._io, "/seq/0"); } - if (!(foo() <= 10)) { - throw new KaitaiStream.ValidationGreaterThanError(10, foo(), _io(), "/seq/0"); + if (!(this.foo <= 10)) { + throw new KaitaiStream.ValidationGreaterThanError(10, this.foo, this._io, "/seq/0"); } } private int foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeStr.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeStr.java index b9a815188..a461e2a03 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeStr.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRangeStr.java @@ -29,11 +29,11 @@ public ValidFailRangeStr(KaitaiStream _io, KaitaiStruct _parent, ValidFailRangeS } private void _read() { this.foo = new String(this._io.readBytes(2), StandardCharsets.US_ASCII); - if (!((foo().compareTo("P") >= 0))) { - throw new KaitaiStream.ValidationLessThanError("P", foo(), _io(), "/seq/0"); + if (!((this.foo.compareTo("P") >= 0))) { + throw new KaitaiStream.ValidationLessThanError("P", this.foo, this._io, "/seq/0"); } - if (!((foo().compareTo("P1") <= 0))) { - throw new KaitaiStream.ValidationGreaterThanError("P1", foo(), _io(), "/seq/0"); + if (!((this.foo.compareTo("P1") <= 0))) { + throw new KaitaiStream.ValidationGreaterThanError("P1", this.foo, this._io, "/seq/0"); } } private String foo; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatAnyofInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatAnyofInt.java new file mode 100644 index 000000000..dd2157630 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatAnyofInt.java @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; + +public class ValidFailRepeatAnyofInt extends KaitaiStruct { + public static ValidFailRepeatAnyofInt fromFile(String fileName) throws IOException { + return new ValidFailRepeatAnyofInt(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatAnyofInt(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatAnyofInt(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatAnyofInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatAnyofInt _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readU1()); + if (!( ((this.foo.get((int) i) == 0) || (this.foo.get((int) i) == 1) || (this.foo.get((int) i) == 65)) )) { + throw new KaitaiStream.ValidationNotAnyOfError(this.foo.get((int) i), this._io, "/seq/0"); + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatAnyofInt _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatAnyofInt _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatContents.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatContents.java new file mode 100644 index 000000000..2f9d29082 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatContents.java @@ -0,0 +1,50 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; + +public class ValidFailRepeatContents extends KaitaiStruct { + public static ValidFailRepeatContents fromFile(String fileName) throws IOException { + return new ValidFailRepeatContents(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatContents(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatContents(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatContents(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatContents _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readBytes(4)); + if (!(Arrays.equals(this.foo.get((int) i), new byte[] { 18, 52, 86, 120 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 18, 52, 86, 120 }, this.foo.get((int) i), this._io, "/seq/0"); + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatContents _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatContents _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatEqInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatEqInt.java new file mode 100644 index 000000000..59ab12500 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatEqInt.java @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; + +public class ValidFailRepeatEqInt extends KaitaiStruct { + public static ValidFailRepeatEqInt fromFile(String fileName) throws IOException { + return new ValidFailRepeatEqInt(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatEqInt(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatEqInt(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatEqInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatEqInt _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readU4be()); + if (!(this.foo.get((int) i) == 305419896)) { + throw new KaitaiStream.ValidationNotEqualError(305419896, this.foo.get((int) i), this._io, "/seq/0"); + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatEqInt _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatEqInt _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatExpr.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatExpr.java new file mode 100644 index 000000000..1259d0171 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatExpr.java @@ -0,0 +1,53 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; + +public class ValidFailRepeatExpr extends KaitaiStruct { + public static ValidFailRepeatExpr fromFile(String fileName) throws IOException { + return new ValidFailRepeatExpr(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatExpr(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatExpr(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatExpr(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatExpr _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readBytes(4)); + { + byte[] _it = this.foo.get((int) i); + if (!(!Arrays.equals(_it, new byte[] { 0, 18, 52, 86 }))) { + throw new KaitaiStream.ValidationExprError(this.foo.get((int) i), this._io, "/seq/0"); + } + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatExpr _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatExpr _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatInst.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatInst.java new file mode 100644 index 000000000..d67e06651 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatInst.java @@ -0,0 +1,61 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; + +public class ValidFailRepeatInst extends KaitaiStruct { + public static ValidFailRepeatInst fromFile(String fileName) throws IOException { + return new ValidFailRepeatInst(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatInst(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatInst(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatInst(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatInst _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + if (inst().size() == 0) { + this.a = this._io.readBytes(0); + } + } + private ArrayList inst; + public ArrayList inst() { + if (this.inst != null) + return this.inst; + long _pos = this._io.pos(); + this._io.seek(0); + this.inst = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.inst.add(this._io.readU4be()); + if (!(this.inst.get((int) i) == 305419896)) { + throw new KaitaiStream.ValidationNotEqualError(305419896, this.inst.get((int) i), this._io, "/instances/inst"); + } + i++; + } + } + this._io.seek(_pos); + return this.inst; + } + private byte[] a; + private ValidFailRepeatInst _root; + private KaitaiStruct _parent; + public byte[] a() { return a; } + public ValidFailRepeatInst _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMaxInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMaxInt.java new file mode 100644 index 000000000..162d2f898 --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMaxInt.java @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; + +public class ValidFailRepeatMaxInt extends KaitaiStruct { + public static ValidFailRepeatMaxInt fromFile(String fileName) throws IOException { + return new ValidFailRepeatMaxInt(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatMaxInt(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatMaxInt(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatMaxInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatMaxInt _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readU1()); + if (!(this.foo.get((int) i) <= 254)) { + throw new KaitaiStream.ValidationGreaterThanError(254, this.foo.get((int) i), this._io, "/seq/0"); + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatMaxInt _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatMaxInt _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMinInt.java b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMinInt.java new file mode 100644 index 000000000..53f39e11e --- /dev/null +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidFailRepeatMinInt.java @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +package io.kaitai.struct.testformats; + +import io.kaitai.struct.ByteBufferKaitaiStream; +import io.kaitai.struct.KaitaiStruct; +import io.kaitai.struct.KaitaiStream; +import java.io.IOException; +import java.util.ArrayList; + +public class ValidFailRepeatMinInt extends KaitaiStruct { + public static ValidFailRepeatMinInt fromFile(String fileName) throws IOException { + return new ValidFailRepeatMinInt(new ByteBufferKaitaiStream(fileName)); + } + + public ValidFailRepeatMinInt(KaitaiStream _io) { + this(_io, null, null); + } + + public ValidFailRepeatMinInt(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public ValidFailRepeatMinInt(KaitaiStream _io, KaitaiStruct _parent, ValidFailRepeatMinInt _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + private void _read() { + this.foo = new ArrayList(); + { + int i = 0; + while (!this._io.isEof()) { + this.foo.add(this._io.readS1()); + if (!(this.foo.get((int) i) >= 0)) { + throw new KaitaiStream.ValidationLessThanError(0, this.foo.get((int) i), this._io, "/seq/0"); + } + i++; + } + } + } + private ArrayList foo; + private ValidFailRepeatMinInt _root; + private KaitaiStruct _parent; + public ArrayList foo() { return foo; } + public ValidFailRepeatMinInt _root() { return _root; } + public KaitaiStruct _parent() { return _parent; } +} diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidLong.java b/compiled/java/src/io/kaitai/struct/testformats/ValidLong.java index b1b89c9ee..381f6bd0c 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidLong.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidLong.java @@ -30,48 +30,48 @@ public ValidLong(KaitaiStream _io, KaitaiStruct _parent, ValidLong _root) { } private void _read() { this.magic1 = this._io.readBytes(6); - if (!(Arrays.equals(magic1(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, magic1(), _io(), "/seq/0"); + if (!(Arrays.equals(this.magic1, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this.magic1, this._io, "/seq/0"); } this.uint8 = this._io.readU1(); - if (!(uint8() == 255)) { - throw new KaitaiStream.ValidationNotEqualError(255, uint8(), _io(), "/seq/1"); + if (!(this.uint8 == 255)) { + throw new KaitaiStream.ValidationNotEqualError(255, this.uint8, this._io, "/seq/1"); } this.sint8 = this._io.readS1(); - if (!(sint8() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint8(), _io(), "/seq/2"); + if (!(this.sint8 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint8, this._io, "/seq/2"); } this.magicUint = new String(this._io.readBytes(10), StandardCharsets.UTF_8); - if (!(magicUint().equals("PACK-U-DEF"))) { - throw new KaitaiStream.ValidationNotEqualError("PACK-U-DEF", magicUint(), _io(), "/seq/3"); + if (!(this.magicUint.equals("PACK-U-DEF"))) { + throw new KaitaiStream.ValidationNotEqualError("PACK-U-DEF", this.magicUint, this._io, "/seq/3"); } this.uint16 = this._io.readU2le(); - if (!(uint16() == 65535)) { - throw new KaitaiStream.ValidationNotEqualError(65535, uint16(), _io(), "/seq/4"); + if (!(this.uint16 == 65535)) { + throw new KaitaiStream.ValidationNotEqualError(65535, this.uint16, this._io, "/seq/4"); } this.uint32 = this._io.readU4le(); - if (!(uint32() == 4294967295L)) { - throw new KaitaiStream.ValidationNotEqualError(4294967295L, uint32(), _io(), "/seq/5"); + if (!(this.uint32 == 4294967295L)) { + throw new KaitaiStream.ValidationNotEqualError(4294967295L, this.uint32, this._io, "/seq/5"); } this.uint64 = this._io.readU8le(); - if (!(uint64() == 0xffffffffffffffffL)) { - throw new KaitaiStream.ValidationNotEqualError(0xffffffffffffffffL, uint64(), _io(), "/seq/6"); + if (!(this.uint64 == 0xffffffffffffffffL)) { + throw new KaitaiStream.ValidationNotEqualError(0xffffffffffffffffL, this.uint64, this._io, "/seq/6"); } this.magicSint = new String(this._io.readBytes(10), StandardCharsets.UTF_8); - if (!(magicSint().equals("PACK-S-DEF"))) { - throw new KaitaiStream.ValidationNotEqualError("PACK-S-DEF", magicSint(), _io(), "/seq/7"); + if (!(this.magicSint.equals("PACK-S-DEF"))) { + throw new KaitaiStream.ValidationNotEqualError("PACK-S-DEF", this.magicSint, this._io, "/seq/7"); } this.sint16 = this._io.readS2le(); - if (!(sint16() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint16(), _io(), "/seq/8"); + if (!(this.sint16 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint16, this._io, "/seq/8"); } this.sint32 = this._io.readS4le(); - if (!(sint32() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint32(), _io(), "/seq/9"); + if (!(this.sint32 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint32, this._io, "/seq/9"); } this.sint64 = this._io.readS8le(); - if (!(sint64() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint64(), _io(), "/seq/10"); + if (!(this.sint64 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint64, this._io, "/seq/10"); } } private byte[] magic1; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidNotParsedIf.java b/compiled/java/src/io/kaitai/struct/testformats/ValidNotParsedIf.java index c98fa18e4..33756d016 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidNotParsedIf.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidNotParsedIf.java @@ -29,14 +29,14 @@ public ValidNotParsedIf(KaitaiStream _io, KaitaiStruct _parent, ValidNotParsedIf private void _read() { if (false) { this.notParsed = this._io.readU1(); - if (!(notParsed() == 42)) { - throw new KaitaiStream.ValidationNotEqualError(42, notParsed(), _io(), "/seq/0"); + if (!(this.notParsed == 42)) { + throw new KaitaiStream.ValidationNotEqualError(42, this.notParsed, this._io, "/seq/0"); } } if (true) { this.parsed = this._io.readU1(); - if (!(parsed() == 80)) { - throw new KaitaiStream.ValidationNotEqualError(80, parsed(), _io(), "/seq/1"); + if (!(this.parsed == 80)) { + throw new KaitaiStream.ValidationNotEqualError(80, this.parsed, this._io, "/seq/1"); } } } diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidOptionalId.java b/compiled/java/src/io/kaitai/struct/testformats/ValidOptionalId.java index 3bc508e7d..f70a937c2 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidOptionalId.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidOptionalId.java @@ -29,18 +29,18 @@ public ValidOptionalId(KaitaiStream _io, KaitaiStruct _parent, ValidOptionalId _ } private void _read() { this._unnamed0 = this._io.readBytes(6); - if (!(Arrays.equals(_unnamed0(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, _unnamed0(), _io(), "/seq/0"); + if (!(Arrays.equals(this._unnamed0, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this._unnamed0, this._io, "/seq/0"); } this._unnamed1 = this._io.readU1(); - if (!(_unnamed1() == 255)) { - throw new KaitaiStream.ValidationNotEqualError(255, _unnamed1(), _io(), "/seq/1"); + if (!(this._unnamed1 == 255)) { + throw new KaitaiStream.ValidationNotEqualError(255, this._unnamed1, this._io, "/seq/1"); } this._unnamed2 = this._io.readS1(); { - byte _it = _unnamed2(); + byte _it = this._unnamed2; if (!(_it == -1)) { - throw new KaitaiStream.ValidationExprError(_unnamed2(), _io(), "/seq/2"); + throw new KaitaiStream.ValidationExprError(this._unnamed2, this._io, "/seq/2"); } } } diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidShort.java b/compiled/java/src/io/kaitai/struct/testformats/ValidShort.java index e08b8926b..7f26bef69 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidShort.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidShort.java @@ -30,48 +30,48 @@ public ValidShort(KaitaiStream _io, KaitaiStruct _parent, ValidShort _root) { } private void _read() { this.magic1 = this._io.readBytes(6); - if (!(Arrays.equals(magic1(), new byte[] { 80, 65, 67, 75, 45, 49 }))) { - throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, magic1(), _io(), "/seq/0"); + if (!(Arrays.equals(this.magic1, new byte[] { 80, 65, 67, 75, 45, 49 }))) { + throw new KaitaiStream.ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, this.magic1, this._io, "/seq/0"); } this.uint8 = this._io.readU1(); - if (!(uint8() == 255)) { - throw new KaitaiStream.ValidationNotEqualError(255, uint8(), _io(), "/seq/1"); + if (!(this.uint8 == 255)) { + throw new KaitaiStream.ValidationNotEqualError(255, this.uint8, this._io, "/seq/1"); } this.sint8 = this._io.readS1(); - if (!(sint8() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint8(), _io(), "/seq/2"); + if (!(this.sint8 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint8, this._io, "/seq/2"); } this.magicUint = new String(this._io.readBytes(10), StandardCharsets.UTF_8); - if (!(magicUint().equals("PACK-U-DEF"))) { - throw new KaitaiStream.ValidationNotEqualError("PACK-U-DEF", magicUint(), _io(), "/seq/3"); + if (!(this.magicUint.equals("PACK-U-DEF"))) { + throw new KaitaiStream.ValidationNotEqualError("PACK-U-DEF", this.magicUint, this._io, "/seq/3"); } this.uint16 = this._io.readU2le(); - if (!(uint16() == 65535)) { - throw new KaitaiStream.ValidationNotEqualError(65535, uint16(), _io(), "/seq/4"); + if (!(this.uint16 == 65535)) { + throw new KaitaiStream.ValidationNotEqualError(65535, this.uint16, this._io, "/seq/4"); } this.uint32 = this._io.readU4le(); - if (!(uint32() == 4294967295L)) { - throw new KaitaiStream.ValidationNotEqualError(4294967295L, uint32(), _io(), "/seq/5"); + if (!(this.uint32 == 4294967295L)) { + throw new KaitaiStream.ValidationNotEqualError(4294967295L, this.uint32, this._io, "/seq/5"); } this.uint64 = this._io.readU8le(); - if (!(uint64() == 0xffffffffffffffffL)) { - throw new KaitaiStream.ValidationNotEqualError(0xffffffffffffffffL, uint64(), _io(), "/seq/6"); + if (!(this.uint64 == 0xffffffffffffffffL)) { + throw new KaitaiStream.ValidationNotEqualError(0xffffffffffffffffL, this.uint64, this._io, "/seq/6"); } this.magicSint = new String(this._io.readBytes(10), StandardCharsets.UTF_8); - if (!(magicSint().equals("PACK-S-DEF"))) { - throw new KaitaiStream.ValidationNotEqualError("PACK-S-DEF", magicSint(), _io(), "/seq/7"); + if (!(this.magicSint.equals("PACK-S-DEF"))) { + throw new KaitaiStream.ValidationNotEqualError("PACK-S-DEF", this.magicSint, this._io, "/seq/7"); } this.sint16 = this._io.readS2le(); - if (!(sint16() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint16(), _io(), "/seq/8"); + if (!(this.sint16 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint16, this._io, "/seq/8"); } this.sint32 = this._io.readS4le(); - if (!(sint32() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint32(), _io(), "/seq/9"); + if (!(this.sint32 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint32, this._io, "/seq/9"); } this.sint64 = this._io.readS8le(); - if (!(sint64() == -1)) { - throw new KaitaiStream.ValidationNotEqualError(-1, sint64(), _io(), "/seq/10"); + if (!(this.sint64 == -1)) { + throw new KaitaiStream.ValidationNotEqualError(-1, this.sint64, this._io, "/seq/10"); } } private byte[] magic1; diff --git a/compiled/java/src/io/kaitai/struct/testformats/ValidSwitch.java b/compiled/java/src/io/kaitai/struct/testformats/ValidSwitch.java index 254a69178..a9818efe6 100644 --- a/compiled/java/src/io/kaitai/struct/testformats/ValidSwitch.java +++ b/compiled/java/src/io/kaitai/struct/testformats/ValidSwitch.java @@ -28,8 +28,8 @@ public ValidSwitch(KaitaiStream _io, KaitaiStruct _parent, ValidSwitch _root) { } private void _read() { this.a = this._io.readU1(); - if (!(a() == 80)) { - throw new KaitaiStream.ValidationNotEqualError(80, a(), _io(), "/seq/0"); + if (!(this.a == 80)) { + throw new KaitaiStream.ValidationNotEqualError(80, this.a, this._io, "/seq/0"); } switch (a()) { case 80: { @@ -41,8 +41,8 @@ private void _read() { break; } } - if (!(b() == 17217)) { - throw new KaitaiStream.ValidationNotEqualError(17217, b(), _io(), "/seq/1"); + if (!(this.b == 17217)) { + throw new KaitaiStream.ValidationNotEqualError(17217, this.b, this._io, "/seq/1"); } } private int a; diff --git a/compiled/javascript/StrPadTermUtf16.js b/compiled/javascript/StrPadTermUtf16.js new file mode 100644 index 000000000..59c272e21 --- /dev/null +++ b/compiled/javascript/StrPadTermUtf16.js @@ -0,0 +1,29 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.StrPadTermUtf16 || (root.StrPadTermUtf16 = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (StrPadTermUtf16_, KaitaiStream) { +var StrPadTermUtf16 = (function() { + function StrPadTermUtf16(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + StrPadTermUtf16.prototype._read = function() { + this.strTerm = KaitaiStream.bytesToStr(KaitaiStream.bytesTerminateMulti(this._io.readBytes(10), [0, 0], false), "UTF-16LE"); + this.strTermInclude = KaitaiStream.bytesToStr(KaitaiStream.bytesTerminateMulti(this._io.readBytes(10), [0, 0], true), "UTF-16LE"); + this.strTermAndPad = KaitaiStream.bytesToStr(KaitaiStream.bytesTerminateMulti(KaitaiStream.bytesStripRight(this._io.readBytes(9), 43), [0, 0], false), "UTF-16LE"); + } + + return StrPadTermUtf16; +})(); +StrPadTermUtf16_.StrPadTermUtf16 = StrPadTermUtf16; +}); diff --git a/compiled/javascript/TermStrzUtf16V1.js b/compiled/javascript/TermStrzUtf16V1.js new file mode 100644 index 000000000..22f48e2a0 --- /dev/null +++ b/compiled/javascript/TermStrzUtf16V1.js @@ -0,0 +1,30 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.TermStrzUtf16V1 || (root.TermStrzUtf16V1 = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (TermStrzUtf16V1_, KaitaiStream) { +var TermStrzUtf16V1 = (function() { + function TermStrzUtf16V1(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + TermStrzUtf16V1.prototype._read = function() { + this.s1 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, true, true), "UTF-16LE"); + this.s2 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, false, true), "UTF-16LE"); + this.term = this._io.readU2le(); + this.s3 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], true, true, true), "UTF-16LE"); + } + + return TermStrzUtf16V1; +})(); +TermStrzUtf16V1_.TermStrzUtf16V1 = TermStrzUtf16V1; +}); diff --git a/compiled/javascript/TermStrzUtf16V2.js b/compiled/javascript/TermStrzUtf16V2.js new file mode 100644 index 000000000..2ce292d49 --- /dev/null +++ b/compiled/javascript/TermStrzUtf16V2.js @@ -0,0 +1,29 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.TermStrzUtf16V2 || (root.TermStrzUtf16V2 = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (TermStrzUtf16V2_, KaitaiStream) { +var TermStrzUtf16V2 = (function() { + function TermStrzUtf16V2(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + TermStrzUtf16V2.prototype._read = function() { + this.s1 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, true, true), "UTF-16LE"); + this.s2 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], true, true, true), "UTF-16LE"); + this.s3 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, false, true), "UTF-16LE"); + } + + return TermStrzUtf16V2; +})(); +TermStrzUtf16V2_.TermStrzUtf16V2 = TermStrzUtf16V2; +}); diff --git a/compiled/javascript/TermStrzUtf16V3.js b/compiled/javascript/TermStrzUtf16V3.js new file mode 100644 index 000000000..ca4787aa7 --- /dev/null +++ b/compiled/javascript/TermStrzUtf16V3.js @@ -0,0 +1,30 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.TermStrzUtf16V3 || (root.TermStrzUtf16V3 = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (TermStrzUtf16V3_, KaitaiStream) { +var TermStrzUtf16V3 = (function() { + function TermStrzUtf16V3(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + TermStrzUtf16V3.prototype._read = function() { + this.s1 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, false, true), "UTF-16LE"); + this.term = this._io.readU2le(); + this.s2 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, false, true), "UTF-16LE"); + this.s3 = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, true, true), "UTF-16LE"); + } + + return TermStrzUtf16V3; +})(); +TermStrzUtf16V3_.TermStrzUtf16V3 = TermStrzUtf16V3; +}); diff --git a/compiled/javascript/TermStrzUtf16V4.js b/compiled/javascript/TermStrzUtf16V4.js new file mode 100644 index 000000000..1593bf198 --- /dev/null +++ b/compiled/javascript/TermStrzUtf16V4.js @@ -0,0 +1,82 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.TermStrzUtf16V4 || (root.TermStrzUtf16V4 = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (TermStrzUtf16V4_, KaitaiStream) { +var TermStrzUtf16V4 = (function() { + function TermStrzUtf16V4(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + TermStrzUtf16V4.prototype._read = function() { + this._raw_s1 = this._io.readBytes(6); + var _io__raw_s1 = new KaitaiStream(this._raw_s1); + this.s1 = new S1Type(_io__raw_s1, this, this._root); + this.skipTerm1 = this._io.readBytes(2); + this._raw_s2 = this._io.readBytes(6); + var _io__raw_s2 = new KaitaiStream(this._raw_s2); + this.s2 = new S2Type(_io__raw_s2, this, this._root); + this.skipTerm2 = this._io.readBytes(2); + this._raw_s3 = this._io.readBytes(6); + var _io__raw_s3 = new KaitaiStream(this._raw_s3); + this.s3 = new S3Type(_io__raw_s3, this, this._root); + } + + var S1Type = TermStrzUtf16V4.S1Type = (function() { + function S1Type(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root; + + this._read(); + } + S1Type.prototype._read = function() { + this.value = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, true, false), "UTF-16LE"); + } + + return S1Type; + })(); + + var S2Type = TermStrzUtf16V4.S2Type = (function() { + function S2Type(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root; + + this._read(); + } + S2Type.prototype._read = function() { + this.value = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], false, false, false), "UTF-16LE"); + } + + return S2Type; + })(); + + var S3Type = TermStrzUtf16V4.S3Type = (function() { + function S3Type(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root; + + this._read(); + } + S3Type.prototype._read = function() { + this.value = KaitaiStream.bytesToStr(this._io.readBytesTermMulti([0, 0], true, true, false), "UTF-16LE"); + } + + return S3Type; + })(); + + return TermStrzUtf16V4; +})(); +TermStrzUtf16V4_.TermStrzUtf16V4 = TermStrzUtf16V4; +}); diff --git a/compiled/javascript/ValidFailInst.js b/compiled/javascript/ValidFailInst.js index dc4950578..d726cc7c2 100644 --- a/compiled/javascript/ValidFailInst.js +++ b/compiled/javascript/ValidFailInst.js @@ -29,10 +29,10 @@ var ValidFailInst = (function() { var _pos = this._io.pos; this._io.seek(5); this._m_inst = this._io.readU1(); - this._io.seek(_pos); - if (!(this.inst == 80)) { - throw new KaitaiStream.ValidationNotEqualError(80, this.inst, this._io, "/instances/inst"); + if (!(this._m_inst == 80)) { + throw new KaitaiStream.ValidationNotEqualError(80, this._m_inst, this._io, "/instances/inst"); } + this._io.seek(_pos); return this._m_inst; } }); diff --git a/compiled/javascript/ValidFailRepeatAnyofInt.js b/compiled/javascript/ValidFailRepeatAnyofInt.js new file mode 100644 index 000000000..6fed01d33 --- /dev/null +++ b/compiled/javascript/ValidFailRepeatAnyofInt.js @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatAnyofInt || (root.ValidFailRepeatAnyofInt = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatAnyofInt_, KaitaiStream) { +var ValidFailRepeatAnyofInt = (function() { + function ValidFailRepeatAnyofInt(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatAnyofInt.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readU1()); + if (!( ((this.foo[i] == 0) || (this.foo[i] == 1) || (this.foo[i] == 65)) )) { + throw new KaitaiStream.ValidationNotAnyOfError(this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatAnyofInt; +})(); +ValidFailRepeatAnyofInt_.ValidFailRepeatAnyofInt = ValidFailRepeatAnyofInt; +}); diff --git a/compiled/javascript/ValidFailRepeatContents.js b/compiled/javascript/ValidFailRepeatContents.js new file mode 100644 index 000000000..ad64e8049 --- /dev/null +++ b/compiled/javascript/ValidFailRepeatContents.js @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatContents || (root.ValidFailRepeatContents = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatContents_, KaitaiStream) { +var ValidFailRepeatContents = (function() { + function ValidFailRepeatContents(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatContents.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readBytes(4)); + if (!((KaitaiStream.byteArrayCompare(this.foo[i], [18, 52, 86, 120]) == 0))) { + throw new KaitaiStream.ValidationNotEqualError([18, 52, 86, 120], this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatContents; +})(); +ValidFailRepeatContents_.ValidFailRepeatContents = ValidFailRepeatContents; +}); diff --git a/compiled/javascript/ValidFailRepeatEqInt.js b/compiled/javascript/ValidFailRepeatEqInt.js new file mode 100644 index 000000000..dde73c997 --- /dev/null +++ b/compiled/javascript/ValidFailRepeatEqInt.js @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatEqInt || (root.ValidFailRepeatEqInt = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatEqInt_, KaitaiStream) { +var ValidFailRepeatEqInt = (function() { + function ValidFailRepeatEqInt(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatEqInt.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readU4be()); + if (!(this.foo[i] == 305419896)) { + throw new KaitaiStream.ValidationNotEqualError(305419896, this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatEqInt; +})(); +ValidFailRepeatEqInt_.ValidFailRepeatEqInt = ValidFailRepeatEqInt; +}); diff --git a/compiled/javascript/ValidFailRepeatExpr.js b/compiled/javascript/ValidFailRepeatExpr.js new file mode 100644 index 000000000..e907f9e1e --- /dev/null +++ b/compiled/javascript/ValidFailRepeatExpr.js @@ -0,0 +1,36 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatExpr || (root.ValidFailRepeatExpr = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatExpr_, KaitaiStream) { +var ValidFailRepeatExpr = (function() { + function ValidFailRepeatExpr(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatExpr.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readBytes(4)); + var _ = this.foo[i]; + if (!((KaitaiStream.byteArrayCompare(_, [0, 18, 52, 86]) != 0))) { + throw new KaitaiStream.ValidationExprError(this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatExpr; +})(); +ValidFailRepeatExpr_.ValidFailRepeatExpr = ValidFailRepeatExpr; +}); diff --git a/compiled/javascript/ValidFailRepeatInst.js b/compiled/javascript/ValidFailRepeatInst.js new file mode 100644 index 000000000..631516199 --- /dev/null +++ b/compiled/javascript/ValidFailRepeatInst.js @@ -0,0 +1,48 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatInst || (root.ValidFailRepeatInst = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatInst_, KaitaiStream) { +var ValidFailRepeatInst = (function() { + function ValidFailRepeatInst(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatInst.prototype._read = function() { + if (this.inst.length == 0) { + this.a = this._io.readBytes(0); + } + } + Object.defineProperty(ValidFailRepeatInst.prototype, 'inst', { + get: function() { + if (this._m_inst !== undefined) + return this._m_inst; + var _pos = this._io.pos; + this._io.seek(0); + this._m_inst = []; + var i = 0; + while (!this._io.isEof()) { + this._m_inst.push(this._io.readU4be()); + if (!(this._m_inst[i] == 305419896)) { + throw new KaitaiStream.ValidationNotEqualError(305419896, this._m_inst[i], this._io, "/instances/inst"); + } + i++; + } + this._io.seek(_pos); + return this._m_inst; + } + }); + + return ValidFailRepeatInst; +})(); +ValidFailRepeatInst_.ValidFailRepeatInst = ValidFailRepeatInst; +}); diff --git a/compiled/javascript/ValidFailRepeatMaxInt.js b/compiled/javascript/ValidFailRepeatMaxInt.js new file mode 100644 index 000000000..67026ca6c --- /dev/null +++ b/compiled/javascript/ValidFailRepeatMaxInt.js @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatMaxInt || (root.ValidFailRepeatMaxInt = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatMaxInt_, KaitaiStream) { +var ValidFailRepeatMaxInt = (function() { + function ValidFailRepeatMaxInt(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatMaxInt.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readU1()); + if (!(this.foo[i] <= 254)) { + throw new KaitaiStream.ValidationGreaterThanError(254, this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatMaxInt; +})(); +ValidFailRepeatMaxInt_.ValidFailRepeatMaxInt = ValidFailRepeatMaxInt; +}); diff --git a/compiled/javascript/ValidFailRepeatMinInt.js b/compiled/javascript/ValidFailRepeatMinInt.js new file mode 100644 index 000000000..b0f6135d3 --- /dev/null +++ b/compiled/javascript/ValidFailRepeatMinInt.js @@ -0,0 +1,35 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'kaitai-struct/KaitaiStream'], factory); + } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') { + factory(exports, require('kaitai-struct/KaitaiStream')); + } else { + factory(root.ValidFailRepeatMinInt || (root.ValidFailRepeatMinInt = {}), root.KaitaiStream); + } +})(typeof self !== 'undefined' ? self : this, function (ValidFailRepeatMinInt_, KaitaiStream) { +var ValidFailRepeatMinInt = (function() { + function ValidFailRepeatMinInt(_io, _parent, _root) { + this._io = _io; + this._parent = _parent; + this._root = _root || this; + + this._read(); + } + ValidFailRepeatMinInt.prototype._read = function() { + this.foo = []; + var i = 0; + while (!this._io.isEof()) { + this.foo.push(this._io.readS1()); + if (!(this.foo[i] >= 0)) { + throw new KaitaiStream.ValidationLessThanError(0, this.foo[i], this._io, "/seq/0"); + } + i++; + } + } + + return ValidFailRepeatMinInt; +})(); +ValidFailRepeatMinInt_.ValidFailRepeatMinInt = ValidFailRepeatMinInt; +}); diff --git a/compiled/lua/str_pad_term_utf16.lua b/compiled/lua/str_pad_term_utf16.lua new file mode 100644 index 000000000..eb3df6095 --- /dev/null +++ b/compiled/lua/str_pad_term_utf16.lua @@ -0,0 +1,24 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") +local str_decode = require("string_decode") + +StrPadTermUtf16 = class.class(KaitaiStruct) + +function StrPadTermUtf16:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function StrPadTermUtf16:_read() + self.str_term = str_decode.decode(KaitaiStream.bytes_terminate_multi(self._io:read_bytes(10), "\000\000", false), "UTF-16LE") + self.str_term_include = str_decode.decode(KaitaiStream.bytes_terminate_multi(self._io:read_bytes(10), "\000\000", true), "UTF-16LE") + self.str_term_and_pad = str_decode.decode(KaitaiStream.bytes_terminate_multi(KaitaiStream.bytes_strip_right(self._io:read_bytes(9), 43), "\000\000", false), "UTF-16LE") +end + + diff --git a/compiled/lua/term_strz_utf16_v1.lua b/compiled/lua/term_strz_utf16_v1.lua new file mode 100644 index 000000000..b91bb6f74 --- /dev/null +++ b/compiled/lua/term_strz_utf16_v1.lua @@ -0,0 +1,25 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") +local str_decode = require("string_decode") + +TermStrzUtf16V1 = class.class(KaitaiStruct) + +function TermStrzUtf16V1:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function TermStrzUtf16V1:_read() + self.s1 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, true, true), "UTF-16LE") + self.s2 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, false, true), "UTF-16LE") + self.term = self._io:read_u2le() + self.s3 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", true, true, true), "UTF-16LE") +end + + diff --git a/compiled/lua/term_strz_utf16_v2.lua b/compiled/lua/term_strz_utf16_v2.lua new file mode 100644 index 000000000..8cd04ef34 --- /dev/null +++ b/compiled/lua/term_strz_utf16_v2.lua @@ -0,0 +1,24 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") +local str_decode = require("string_decode") + +TermStrzUtf16V2 = class.class(KaitaiStruct) + +function TermStrzUtf16V2:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function TermStrzUtf16V2:_read() + self.s1 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, true, true), "UTF-16LE") + self.s2 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", true, true, true), "UTF-16LE") + self.s3 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, false, true), "UTF-16LE") +end + + diff --git a/compiled/lua/term_strz_utf16_v3.lua b/compiled/lua/term_strz_utf16_v3.lua new file mode 100644 index 000000000..1bd2093dc --- /dev/null +++ b/compiled/lua/term_strz_utf16_v3.lua @@ -0,0 +1,25 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") +local str_decode = require("string_decode") + +TermStrzUtf16V3 = class.class(KaitaiStruct) + +function TermStrzUtf16V3:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function TermStrzUtf16V3:_read() + self.s1 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, false, true), "UTF-16LE") + self.term = self._io:read_u2le() + self.s2 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, false, true), "UTF-16LE") + self.s3 = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, true, true), "UTF-16LE") +end + + diff --git a/compiled/lua/term_strz_utf16_v4.lua b/compiled/lua/term_strz_utf16_v4.lua new file mode 100644 index 000000000..c76eaba9a --- /dev/null +++ b/compiled/lua/term_strz_utf16_v4.lua @@ -0,0 +1,75 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") +local stringstream = require("string_stream") +local str_decode = require("string_decode") + +TermStrzUtf16V4 = class.class(KaitaiStruct) + +function TermStrzUtf16V4:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function TermStrzUtf16V4:_read() + self._raw_s1 = self._io:read_bytes(6) + local _io = KaitaiStream(stringstream(self._raw_s1)) + self.s1 = TermStrzUtf16V4.S1Type(_io, self, self._root) + self.skip_term1 = self._io:read_bytes(2) + self._raw_s2 = self._io:read_bytes(6) + local _io = KaitaiStream(stringstream(self._raw_s2)) + self.s2 = TermStrzUtf16V4.S2Type(_io, self, self._root) + self.skip_term2 = self._io:read_bytes(2) + self._raw_s3 = self._io:read_bytes(6) + local _io = KaitaiStream(stringstream(self._raw_s3)) + self.s3 = TermStrzUtf16V4.S3Type(_io, self, self._root) +end + + +TermStrzUtf16V4.S1Type = class.class(KaitaiStruct) + +function TermStrzUtf16V4.S1Type:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root + self:_read() +end + +function TermStrzUtf16V4.S1Type:_read() + self.value = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, true, false), "UTF-16LE") +end + + +TermStrzUtf16V4.S2Type = class.class(KaitaiStruct) + +function TermStrzUtf16V4.S2Type:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root + self:_read() +end + +function TermStrzUtf16V4.S2Type:_read() + self.value = str_decode.decode(self._io:read_bytes_term_multi("\000\000", false, false, false), "UTF-16LE") +end + + +TermStrzUtf16V4.S3Type = class.class(KaitaiStruct) + +function TermStrzUtf16V4.S3Type:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root + self:_read() +end + +function TermStrzUtf16V4.S3Type:_read() + self.value = str_decode.decode(self._io:read_bytes_term_multi("\000\000", true, true, false), "UTF-16LE") +end + + diff --git a/compiled/lua/valid_fail_inst.lua b/compiled/lua/valid_fail_inst.lua index 712a2a988..ee7afdc61 100644 --- a/compiled/lua/valid_fail_inst.lua +++ b/compiled/lua/valid_fail_inst.lua @@ -29,10 +29,10 @@ function ValidFailInst.property.inst:get() local _pos = self._io:pos() self._io:seek(5) self._m_inst = self._io:read_u1() - self._io:seek(_pos) - if not(self.inst == 80) then - error("not equal, expected " .. 80 .. ", but got " .. self.inst) + if not(self._m_inst == 80) then + error("not equal, expected " .. 80 .. ", but got " .. self._m_inst) end + self._io:seek(_pos) return self._m_inst end diff --git a/compiled/lua/valid_fail_repeat_anyof_int.lua b/compiled/lua/valid_fail_repeat_anyof_int.lua new file mode 100644 index 000000000..cd20ce4c4 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_anyof_int.lua @@ -0,0 +1,29 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatAnyofInt = class.class(KaitaiStruct) + +function ValidFailRepeatAnyofInt:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatAnyofInt:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_u1() + if not( ((self.foo[i + 1] == 0) or (self.foo[i + 1] == 1) or (self.foo[i + 1] == 65)) ) then + error("ValidationNotAnyOfError") + end + i = i + 1 + end +end + + diff --git a/compiled/lua/valid_fail_repeat_contents.lua b/compiled/lua/valid_fail_repeat_contents.lua new file mode 100644 index 000000000..a1f589ad0 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_contents.lua @@ -0,0 +1,29 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatContents = class.class(KaitaiStruct) + +function ValidFailRepeatContents:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatContents:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_bytes(4) + if not(self.foo[i + 1] == "\018\052\086\120") then + error("not equal, expected " .. "\018\052\086\120" .. ", but got " .. self.foo[i + 1]) + end + i = i + 1 + end +end + + diff --git a/compiled/lua/valid_fail_repeat_eq_int.lua b/compiled/lua/valid_fail_repeat_eq_int.lua new file mode 100644 index 000000000..48bc7d928 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_eq_int.lua @@ -0,0 +1,29 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatEqInt = class.class(KaitaiStruct) + +function ValidFailRepeatEqInt:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatEqInt:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_u4be() + if not(self.foo[i + 1] == 305419896) then + error("not equal, expected " .. 305419896 .. ", but got " .. self.foo[i + 1]) + end + i = i + 1 + end +end + + diff --git a/compiled/lua/valid_fail_repeat_expr.lua b/compiled/lua/valid_fail_repeat_expr.lua new file mode 100644 index 000000000..bdc692ba1 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_expr.lua @@ -0,0 +1,30 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatExpr = class.class(KaitaiStruct) + +function ValidFailRepeatExpr:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatExpr:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_bytes(4) + local _ = self.foo[i + 1] + if not(_ ~= "\000\018\052\086") then + error("ValidationExprError") + end + i = i + 1 + end +end + + diff --git a/compiled/lua/valid_fail_repeat_inst.lua b/compiled/lua/valid_fail_repeat_inst.lua new file mode 100644 index 000000000..4701d96ec --- /dev/null +++ b/compiled/lua/valid_fail_repeat_inst.lua @@ -0,0 +1,44 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatInst = class.class(KaitaiStruct) + +function ValidFailRepeatInst:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatInst:_read() + if #self.inst == 0 then + self.a = self._io:read_bytes(0) + end +end + +ValidFailRepeatInst.property.inst = {} +function ValidFailRepeatInst.property.inst:get() + if self._m_inst ~= nil then + return self._m_inst + end + + local _pos = self._io:pos() + self._io:seek(0) + self._m_inst = {} + local i = 0 + while not self._io:is_eof() do + self._m_inst[i + 1] = self._io:read_u4be() + if not(self._m_inst[i + 1] == 305419896) then + error("not equal, expected " .. 305419896 .. ", but got " .. self._m_inst[i + 1]) + end + i = i + 1 + end + self._io:seek(_pos) + return self._m_inst +end + + diff --git a/compiled/lua/valid_fail_repeat_max_int.lua b/compiled/lua/valid_fail_repeat_max_int.lua new file mode 100644 index 000000000..6a1f78350 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_max_int.lua @@ -0,0 +1,29 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatMaxInt = class.class(KaitaiStruct) + +function ValidFailRepeatMaxInt:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatMaxInt:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_u1() + if not(self.foo[i + 1] <= 254) then + error("ValidationGreaterThanError") + end + i = i + 1 + end +end + + diff --git a/compiled/lua/valid_fail_repeat_min_int.lua b/compiled/lua/valid_fail_repeat_min_int.lua new file mode 100644 index 000000000..ec7f50b69 --- /dev/null +++ b/compiled/lua/valid_fail_repeat_min_int.lua @@ -0,0 +1,29 @@ +-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +-- +-- This file is compatible with Lua 5.3 + +local class = require("class") +require("kaitaistruct") + +ValidFailRepeatMinInt = class.class(KaitaiStruct) + +function ValidFailRepeatMinInt:_init(io, parent, root) + KaitaiStruct._init(self, io) + self._parent = parent + self._root = root or self + self:_read() +end + +function ValidFailRepeatMinInt:_read() + self.foo = {} + local i = 0 + while not self._io:is_eof() do + self.foo[i + 1] = self._io:read_s1() + if not(self.foo[i + 1] >= 0) then + error("ValidationLessThanError") + end + i = i + 1 + end +end + + diff --git a/compiled/nim/str_pad_term_utf16.nim b/compiled/nim/str_pad_term_utf16.nim new file mode 100644 index 000000000..489109e01 --- /dev/null +++ b/compiled/nim/str_pad_term_utf16.nim @@ -0,0 +1,31 @@ +import kaitai_struct_nim_runtime +import options + +type + StrPadTermUtf16* = ref object of KaitaiStruct + `strTerm`*: string + `strTermInclude`*: string + `strTermAndPad`*: string + `parent`*: KaitaiStruct + +proc read*(_: typedesc[StrPadTermUtf16], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): StrPadTermUtf16 + + +proc read*(_: typedesc[StrPadTermUtf16], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): StrPadTermUtf16 = + template this: untyped = result + this = new(StrPadTermUtf16) + let root = if root == nil: cast[StrPadTermUtf16](this) else: cast[StrPadTermUtf16](root) + this.io = io + this.root = root + this.parent = parent + + let strTermExpr = encode(this.io.readBytes(int(10)).bytesTerminateMulti(@[0'u8, 0'u8], false), "UTF-16LE") + this.strTerm = strTermExpr + let strTermIncludeExpr = encode(this.io.readBytes(int(10)).bytesTerminateMulti(@[0'u8, 0'u8], true), "UTF-16LE") + this.strTermInclude = strTermIncludeExpr + let strTermAndPadExpr = encode(this.io.readBytes(int(9)).bytesStripRight(43).bytesTerminateMulti(@[0'u8, 0'u8], false), "UTF-16LE") + this.strTermAndPad = strTermAndPadExpr + +proc fromFile*(_: typedesc[StrPadTermUtf16], filename: string): StrPadTermUtf16 = + StrPadTermUtf16.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/term_strz_utf16_v1.nim b/compiled/nim/term_strz_utf16_v1.nim new file mode 100644 index 000000000..fd1a5dce5 --- /dev/null +++ b/compiled/nim/term_strz_utf16_v1.nim @@ -0,0 +1,34 @@ +import kaitai_struct_nim_runtime +import options + +type + TermStrzUtf16V1* = ref object of KaitaiStruct + `s1`*: string + `s2`*: string + `term`*: uint16 + `s3`*: string + `parent`*: KaitaiStruct + +proc read*(_: typedesc[TermStrzUtf16V1], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V1 + + +proc read*(_: typedesc[TermStrzUtf16V1], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V1 = + template this: untyped = result + this = new(TermStrzUtf16V1) + let root = if root == nil: cast[TermStrzUtf16V1](this) else: cast[TermStrzUtf16V1](root) + this.io = io + this.root = root + this.parent = parent + + let s1Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, true, true), "UTF-16LE") + this.s1 = s1Expr + let s2Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, false, true), "UTF-16LE") + this.s2 = s2Expr + let termExpr = this.io.readU2le() + this.term = termExpr + let s3Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], true, true, true), "UTF-16LE") + this.s3 = s3Expr + +proc fromFile*(_: typedesc[TermStrzUtf16V1], filename: string): TermStrzUtf16V1 = + TermStrzUtf16V1.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/term_strz_utf16_v2.nim b/compiled/nim/term_strz_utf16_v2.nim new file mode 100644 index 000000000..59f2c97a8 --- /dev/null +++ b/compiled/nim/term_strz_utf16_v2.nim @@ -0,0 +1,31 @@ +import kaitai_struct_nim_runtime +import options + +type + TermStrzUtf16V2* = ref object of KaitaiStruct + `s1`*: string + `s2`*: string + `s3`*: string + `parent`*: KaitaiStruct + +proc read*(_: typedesc[TermStrzUtf16V2], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V2 + + +proc read*(_: typedesc[TermStrzUtf16V2], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V2 = + template this: untyped = result + this = new(TermStrzUtf16V2) + let root = if root == nil: cast[TermStrzUtf16V2](this) else: cast[TermStrzUtf16V2](root) + this.io = io + this.root = root + this.parent = parent + + let s1Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, true, true), "UTF-16LE") + this.s1 = s1Expr + let s2Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], true, true, true), "UTF-16LE") + this.s2 = s2Expr + let s3Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, false, true), "UTF-16LE") + this.s3 = s3Expr + +proc fromFile*(_: typedesc[TermStrzUtf16V2], filename: string): TermStrzUtf16V2 = + TermStrzUtf16V2.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/term_strz_utf16_v3.nim b/compiled/nim/term_strz_utf16_v3.nim new file mode 100644 index 000000000..779977872 --- /dev/null +++ b/compiled/nim/term_strz_utf16_v3.nim @@ -0,0 +1,34 @@ +import kaitai_struct_nim_runtime +import options + +type + TermStrzUtf16V3* = ref object of KaitaiStruct + `s1`*: string + `term`*: uint16 + `s2`*: string + `s3`*: string + `parent`*: KaitaiStruct + +proc read*(_: typedesc[TermStrzUtf16V3], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V3 + + +proc read*(_: typedesc[TermStrzUtf16V3], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V3 = + template this: untyped = result + this = new(TermStrzUtf16V3) + let root = if root == nil: cast[TermStrzUtf16V3](this) else: cast[TermStrzUtf16V3](root) + this.io = io + this.root = root + this.parent = parent + + let s1Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, false, true), "UTF-16LE") + this.s1 = s1Expr + let termExpr = this.io.readU2le() + this.term = termExpr + let s2Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, false, true), "UTF-16LE") + this.s2 = s2Expr + let s3Expr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, true, true), "UTF-16LE") + this.s3 = s3Expr + +proc fromFile*(_: typedesc[TermStrzUtf16V3], filename: string): TermStrzUtf16V3 = + TermStrzUtf16V3.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/term_strz_utf16_v4.nim b/compiled/nim/term_strz_utf16_v4.nim new file mode 100644 index 000000000..475421c4c --- /dev/null +++ b/compiled/nim/term_strz_utf16_v4.nim @@ -0,0 +1,103 @@ +import kaitai_struct_nim_runtime +import options + +type + TermStrzUtf16V4* = ref object of KaitaiStruct + `s1`*: TermStrzUtf16V4_S1Type + `skipTerm1`*: seq[byte] + `s2`*: TermStrzUtf16V4_S2Type + `skipTerm2`*: seq[byte] + `s3`*: TermStrzUtf16V4_S3Type + `parent`*: KaitaiStruct + `rawS1`*: seq[byte] + `rawS2`*: seq[byte] + `rawS3`*: seq[byte] + TermStrzUtf16V4_S1Type* = ref object of KaitaiStruct + `value`*: string + `parent`*: TermStrzUtf16V4 + TermStrzUtf16V4_S2Type* = ref object of KaitaiStruct + `value`*: string + `parent`*: TermStrzUtf16V4 + TermStrzUtf16V4_S3Type* = ref object of KaitaiStruct + `value`*: string + `parent`*: TermStrzUtf16V4 + +proc read*(_: typedesc[TermStrzUtf16V4], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V4 +proc read*(_: typedesc[TermStrzUtf16V4_S1Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S1Type +proc read*(_: typedesc[TermStrzUtf16V4_S2Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S2Type +proc read*(_: typedesc[TermStrzUtf16V4_S3Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S3Type + + +proc read*(_: typedesc[TermStrzUtf16V4], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): TermStrzUtf16V4 = + template this: untyped = result + this = new(TermStrzUtf16V4) + let root = if root == nil: cast[TermStrzUtf16V4](this) else: cast[TermStrzUtf16V4](root) + this.io = io + this.root = root + this.parent = parent + + let rawS1Expr = this.io.readBytes(int(6)) + this.rawS1 = rawS1Expr + let rawS1Io = newKaitaiStream(rawS1Expr) + let s1Expr = TermStrzUtf16V4_S1Type.read(rawS1Io, this.root, this) + this.s1 = s1Expr + let skipTerm1Expr = this.io.readBytes(int(2)) + this.skipTerm1 = skipTerm1Expr + let rawS2Expr = this.io.readBytes(int(6)) + this.rawS2 = rawS2Expr + let rawS2Io = newKaitaiStream(rawS2Expr) + let s2Expr = TermStrzUtf16V4_S2Type.read(rawS2Io, this.root, this) + this.s2 = s2Expr + let skipTerm2Expr = this.io.readBytes(int(2)) + this.skipTerm2 = skipTerm2Expr + let rawS3Expr = this.io.readBytes(int(6)) + this.rawS3 = rawS3Expr + let rawS3Io = newKaitaiStream(rawS3Expr) + let s3Expr = TermStrzUtf16V4_S3Type.read(rawS3Io, this.root, this) + this.s3 = s3Expr + +proc fromFile*(_: typedesc[TermStrzUtf16V4], filename: string): TermStrzUtf16V4 = + TermStrzUtf16V4.read(newKaitaiFileStream(filename), nil, nil) + +proc read*(_: typedesc[TermStrzUtf16V4_S1Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S1Type = + template this: untyped = result + this = new(TermStrzUtf16V4_S1Type) + let root = if root == nil: cast[TermStrzUtf16V4](this) else: cast[TermStrzUtf16V4](root) + this.io = io + this.root = root + this.parent = parent + + let valueExpr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, true, false), "UTF-16LE") + this.value = valueExpr + +proc fromFile*(_: typedesc[TermStrzUtf16V4_S1Type], filename: string): TermStrzUtf16V4_S1Type = + TermStrzUtf16V4_S1Type.read(newKaitaiFileStream(filename), nil, nil) + +proc read*(_: typedesc[TermStrzUtf16V4_S2Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S2Type = + template this: untyped = result + this = new(TermStrzUtf16V4_S2Type) + let root = if root == nil: cast[TermStrzUtf16V4](this) else: cast[TermStrzUtf16V4](root) + this.io = io + this.root = root + this.parent = parent + + let valueExpr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], false, false, false), "UTF-16LE") + this.value = valueExpr + +proc fromFile*(_: typedesc[TermStrzUtf16V4_S2Type], filename: string): TermStrzUtf16V4_S2Type = + TermStrzUtf16V4_S2Type.read(newKaitaiFileStream(filename), nil, nil) + +proc read*(_: typedesc[TermStrzUtf16V4_S3Type], io: KaitaiStream, root: KaitaiStruct, parent: TermStrzUtf16V4): TermStrzUtf16V4_S3Type = + template this: untyped = result + this = new(TermStrzUtf16V4_S3Type) + let root = if root == nil: cast[TermStrzUtf16V4](this) else: cast[TermStrzUtf16V4](root) + this.io = io + this.root = root + this.parent = parent + + let valueExpr = encode(this.io.readBytesTermMulti(@[0'u8, 0'u8], true, true, false), "UTF-16LE") + this.value = valueExpr + +proc fromFile*(_: typedesc[TermStrzUtf16V4_S3Type], filename: string): TermStrzUtf16V4_S3Type = + TermStrzUtf16V4_S3Type.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_anyof_int.nim b/compiled/nim/valid_fail_repeat_anyof_int.nim new file mode 100644 index 000000000..59dd3b566 --- /dev/null +++ b/compiled/nim/valid_fail_repeat_anyof_int.nim @@ -0,0 +1,29 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatAnyofInt* = ref object of KaitaiStruct + `foo`*: seq[uint8] + `parent`*: KaitaiStruct + +proc read*(_: typedesc[ValidFailRepeatAnyofInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatAnyofInt + + +proc read*(_: typedesc[ValidFailRepeatAnyofInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatAnyofInt = + template this: untyped = result + this = new(ValidFailRepeatAnyofInt) + let root = if root == nil: cast[ValidFailRepeatAnyofInt](this) else: cast[ValidFailRepeatAnyofInt](root) + this.io = io + this.root = root + this.parent = parent + + block: + var i: int + while not this.io.isEof: + let it = this.io.readU1() + this.foo.add(it) + inc i + +proc fromFile*(_: typedesc[ValidFailRepeatAnyofInt], filename: string): ValidFailRepeatAnyofInt = + ValidFailRepeatAnyofInt.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_contents.nim b/compiled/nim/valid_fail_repeat_contents.nim new file mode 100644 index 000000000..e2d38a85c --- /dev/null +++ b/compiled/nim/valid_fail_repeat_contents.nim @@ -0,0 +1,29 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatContents* = ref object of KaitaiStruct + `foo`*: seq[seq[byte]] + `parent`*: KaitaiStruct + +proc read*(_: typedesc[ValidFailRepeatContents], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatContents + + +proc read*(_: typedesc[ValidFailRepeatContents], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatContents = + template this: untyped = result + this = new(ValidFailRepeatContents) + let root = if root == nil: cast[ValidFailRepeatContents](this) else: cast[ValidFailRepeatContents](root) + this.io = io + this.root = root + this.parent = parent + + block: + var i: int + while not this.io.isEof: + let it = this.io.readBytes(int(4)) + this.foo.add(it) + inc i + +proc fromFile*(_: typedesc[ValidFailRepeatContents], filename: string): ValidFailRepeatContents = + ValidFailRepeatContents.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_eq_int.nim b/compiled/nim/valid_fail_repeat_eq_int.nim new file mode 100644 index 000000000..5d627ea9a --- /dev/null +++ b/compiled/nim/valid_fail_repeat_eq_int.nim @@ -0,0 +1,29 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatEqInt* = ref object of KaitaiStruct + `foo`*: seq[uint32] + `parent`*: KaitaiStruct + +proc read*(_: typedesc[ValidFailRepeatEqInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatEqInt + + +proc read*(_: typedesc[ValidFailRepeatEqInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatEqInt = + template this: untyped = result + this = new(ValidFailRepeatEqInt) + let root = if root == nil: cast[ValidFailRepeatEqInt](this) else: cast[ValidFailRepeatEqInt](root) + this.io = io + this.root = root + this.parent = parent + + block: + var i: int + while not this.io.isEof: + let it = this.io.readU4be() + this.foo.add(it) + inc i + +proc fromFile*(_: typedesc[ValidFailRepeatEqInt], filename: string): ValidFailRepeatEqInt = + ValidFailRepeatEqInt.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_inst.nim b/compiled/nim/valid_fail_repeat_inst.nim new file mode 100644 index 000000000..143728e26 --- /dev/null +++ b/compiled/nim/valid_fail_repeat_inst.nim @@ -0,0 +1,44 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatInst* = ref object of KaitaiStruct + `a`*: seq[byte] + `parent`*: KaitaiStruct + `instInst`: seq[uint32] + `instInstFlag`: bool + +proc read*(_: typedesc[ValidFailRepeatInst], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatInst + +proc inst*(this: ValidFailRepeatInst): seq[uint32] + +proc read*(_: typedesc[ValidFailRepeatInst], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatInst = + template this: untyped = result + this = new(ValidFailRepeatInst) + let root = if root == nil: cast[ValidFailRepeatInst](this) else: cast[ValidFailRepeatInst](root) + this.io = io + this.root = root + this.parent = parent + + if len(this.inst) == 0: + let aExpr = this.io.readBytes(int(0)) + this.a = aExpr + +proc inst(this: ValidFailRepeatInst): seq[uint32] = + if this.instInstFlag: + return this.instInst + let pos = this.io.pos() + this.io.seek(int(0)) + block: + var i: int + while not this.io.isEof: + let it = this.io.readU4be() + this.instInst.add(it) + inc i + this.io.seek(pos) + this.instInstFlag = true + return this.instInst + +proc fromFile*(_: typedesc[ValidFailRepeatInst], filename: string): ValidFailRepeatInst = + ValidFailRepeatInst.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_max_int.nim b/compiled/nim/valid_fail_repeat_max_int.nim new file mode 100644 index 000000000..eefa34851 --- /dev/null +++ b/compiled/nim/valid_fail_repeat_max_int.nim @@ -0,0 +1,29 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatMaxInt* = ref object of KaitaiStruct + `foo`*: seq[uint8] + `parent`*: KaitaiStruct + +proc read*(_: typedesc[ValidFailRepeatMaxInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatMaxInt + + +proc read*(_: typedesc[ValidFailRepeatMaxInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatMaxInt = + template this: untyped = result + this = new(ValidFailRepeatMaxInt) + let root = if root == nil: cast[ValidFailRepeatMaxInt](this) else: cast[ValidFailRepeatMaxInt](root) + this.io = io + this.root = root + this.parent = parent + + block: + var i: int + while not this.io.isEof: + let it = this.io.readU1() + this.foo.add(it) + inc i + +proc fromFile*(_: typedesc[ValidFailRepeatMaxInt], filename: string): ValidFailRepeatMaxInt = + ValidFailRepeatMaxInt.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/nim/valid_fail_repeat_min_int.nim b/compiled/nim/valid_fail_repeat_min_int.nim new file mode 100644 index 000000000..e53a619ef --- /dev/null +++ b/compiled/nim/valid_fail_repeat_min_int.nim @@ -0,0 +1,29 @@ +import kaitai_struct_nim_runtime +import options + +type + ValidFailRepeatMinInt* = ref object of KaitaiStruct + `foo`*: seq[int8] + `parent`*: KaitaiStruct + +proc read*(_: typedesc[ValidFailRepeatMinInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatMinInt + + +proc read*(_: typedesc[ValidFailRepeatMinInt], io: KaitaiStream, root: KaitaiStruct, parent: KaitaiStruct): ValidFailRepeatMinInt = + template this: untyped = result + this = new(ValidFailRepeatMinInt) + let root = if root == nil: cast[ValidFailRepeatMinInt](this) else: cast[ValidFailRepeatMinInt](root) + this.io = io + this.root = root + this.parent = parent + + block: + var i: int + while not this.io.isEof: + let it = this.io.readS1() + this.foo.add(it) + inc i + +proc fromFile*(_: typedesc[ValidFailRepeatMinInt], filename: string): ValidFailRepeatMinInt = + ValidFailRepeatMinInt.read(newKaitaiFileStream(filename), nil, nil) + diff --git a/compiled/perl/StrPadTermUtf16.pm b/compiled/perl/StrPadTermUtf16.pm new file mode 100644 index 000000000..7c219fd2b --- /dev/null +++ b/compiled/perl/StrPadTermUtf16.pm @@ -0,0 +1,58 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; +use Encode; + +######################################################################## +package StrPadTermUtf16; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{str_term} = Encode::decode("UTF-16LE", IO::KaitaiStruct::Stream::bytes_terminate_multi($self->{_io}->read_bytes(10), pack('C*', (0, 0)), 0)); + $self->{str_term_include} = Encode::decode("UTF-16LE", IO::KaitaiStruct::Stream::bytes_terminate_multi($self->{_io}->read_bytes(10), pack('C*', (0, 0)), 1)); + $self->{str_term_and_pad} = Encode::decode("UTF-16LE", IO::KaitaiStruct::Stream::bytes_terminate_multi(IO::KaitaiStruct::Stream::bytes_strip_right($self->{_io}->read_bytes(9), 43), pack('C*', (0, 0)), 0)); +} + +sub str_term { + my ($self) = @_; + return $self->{str_term}; +} + +sub str_term_include { + my ($self) = @_; + return $self->{str_term_include}; +} + +sub str_term_and_pad { + my ($self) = @_; + return $self->{str_term_and_pad}; +} + +1; diff --git a/compiled/perl/TermStrzUtf16V1.pm b/compiled/perl/TermStrzUtf16V1.pm new file mode 100644 index 000000000..e2beefed1 --- /dev/null +++ b/compiled/perl/TermStrzUtf16V1.pm @@ -0,0 +1,64 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; +use Encode; + +######################################################################## +package TermStrzUtf16V1; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{s1} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 1, 1)); + $self->{s2} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 0, 1)); + $self->{term} = $self->{_io}->read_u2le(); + $self->{s3} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 1, 1, 1)); +} + +sub s1 { + my ($self) = @_; + return $self->{s1}; +} + +sub s2 { + my ($self) = @_; + return $self->{s2}; +} + +sub term { + my ($self) = @_; + return $self->{term}; +} + +sub s3 { + my ($self) = @_; + return $self->{s3}; +} + +1; diff --git a/compiled/perl/TermStrzUtf16V2.pm b/compiled/perl/TermStrzUtf16V2.pm new file mode 100644 index 000000000..880303b16 --- /dev/null +++ b/compiled/perl/TermStrzUtf16V2.pm @@ -0,0 +1,58 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; +use Encode; + +######################################################################## +package TermStrzUtf16V2; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{s1} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 1, 1)); + $self->{s2} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 1, 1, 1)); + $self->{s3} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 0, 1)); +} + +sub s1 { + my ($self) = @_; + return $self->{s1}; +} + +sub s2 { + my ($self) = @_; + return $self->{s2}; +} + +sub s3 { + my ($self) = @_; + return $self->{s3}; +} + +1; diff --git a/compiled/perl/TermStrzUtf16V3.pm b/compiled/perl/TermStrzUtf16V3.pm new file mode 100644 index 000000000..ff4876083 --- /dev/null +++ b/compiled/perl/TermStrzUtf16V3.pm @@ -0,0 +1,64 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; +use Encode; + +######################################################################## +package TermStrzUtf16V3; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{s1} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 0, 1)); + $self->{term} = $self->{_io}->read_u2le(); + $self->{s2} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 0, 1)); + $self->{s3} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 1, 1)); +} + +sub s1 { + my ($self) = @_; + return $self->{s1}; +} + +sub term { + my ($self) = @_; + return $self->{term}; +} + +sub s2 { + my ($self) = @_; + return $self->{s2}; +} + +sub s3 { + my ($self) = @_; + return $self->{s3}; +} + +1; diff --git a/compiled/perl/TermStrzUtf16V4.pm b/compiled/perl/TermStrzUtf16V4.pm new file mode 100644 index 000000000..d80e724ae --- /dev/null +++ b/compiled/perl/TermStrzUtf16V4.pm @@ -0,0 +1,205 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; +use Encode; + +######################################################################## +package TermStrzUtf16V4; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{_raw_s1} = $self->{_io}->read_bytes(6); + my $io__raw_s1 = IO::KaitaiStruct::Stream->new($self->{_raw_s1}); + $self->{s1} = TermStrzUtf16V4::S1Type->new($io__raw_s1, $self, $self->{_root}); + $self->{skip_term1} = $self->{_io}->read_bytes(2); + $self->{_raw_s2} = $self->{_io}->read_bytes(6); + my $io__raw_s2 = IO::KaitaiStruct::Stream->new($self->{_raw_s2}); + $self->{s2} = TermStrzUtf16V4::S2Type->new($io__raw_s2, $self, $self->{_root}); + $self->{skip_term2} = $self->{_io}->read_bytes(2); + $self->{_raw_s3} = $self->{_io}->read_bytes(6); + my $io__raw_s3 = IO::KaitaiStruct::Stream->new($self->{_raw_s3}); + $self->{s3} = TermStrzUtf16V4::S3Type->new($io__raw_s3, $self, $self->{_root}); +} + +sub s1 { + my ($self) = @_; + return $self->{s1}; +} + +sub skip_term1 { + my ($self) = @_; + return $self->{skip_term1}; +} + +sub s2 { + my ($self) = @_; + return $self->{s2}; +} + +sub skip_term2 { + my ($self) = @_; + return $self->{skip_term2}; +} + +sub s3 { + my ($self) = @_; + return $self->{s3}; +} + +sub _raw_s1 { + my ($self) = @_; + return $self->{_raw_s1}; +} + +sub _raw_s2 { + my ($self) = @_; + return $self->{_raw_s2}; +} + +sub _raw_s3 { + my ($self) = @_; + return $self->{_raw_s3}; +} + +######################################################################## +package TermStrzUtf16V4::S1Type; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{value} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 1, 0)); +} + +sub value { + my ($self) = @_; + return $self->{value}; +} + +######################################################################## +package TermStrzUtf16V4::S2Type; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{value} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 0, 0, 0)); +} + +sub value { + my ($self) = @_; + return $self->{value}; +} + +######################################################################## +package TermStrzUtf16V4::S3Type; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{value} = Encode::decode("UTF-16LE", $self->{_io}->read_bytes_term_multi(pack('C*', (0, 0)), 1, 1, 0)); +} + +sub value { + my ($self) = @_; + return $self->{value}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatAnyofInt.pm b/compiled/perl/ValidFailRepeatAnyofInt.pm new file mode 100644 index 000000000..04c3bd406 --- /dev/null +++ b/compiled/perl/ValidFailRepeatAnyofInt.pm @@ -0,0 +1,48 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatAnyofInt; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{foo} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{foo}}, $self->{_io}->read_u1(); + } +} + +sub foo { + my ($self) = @_; + return $self->{foo}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatContents.pm b/compiled/perl/ValidFailRepeatContents.pm new file mode 100644 index 000000000..c28bbb6f1 --- /dev/null +++ b/compiled/perl/ValidFailRepeatContents.pm @@ -0,0 +1,48 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatContents; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{foo} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{foo}}, $self->{_io}->read_bytes(4); + } +} + +sub foo { + my ($self) = @_; + return $self->{foo}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatEqInt.pm b/compiled/perl/ValidFailRepeatEqInt.pm new file mode 100644 index 000000000..71b17f4b3 --- /dev/null +++ b/compiled/perl/ValidFailRepeatEqInt.pm @@ -0,0 +1,48 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatEqInt; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{foo} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{foo}}, $self->{_io}->read_u4be(); + } +} + +sub foo { + my ($self) = @_; + return $self->{foo}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatInst.pm b/compiled/perl/ValidFailRepeatInst.pm new file mode 100644 index 000000000..9a9c70a02 --- /dev/null +++ b/compiled/perl/ValidFailRepeatInst.pm @@ -0,0 +1,60 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatInst; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + if (scalar(@{$self->inst()}) == 0) { + $self->{a} = $self->{_io}->read_bytes(0); + } +} + +sub inst { + my ($self) = @_; + return $self->{inst} if ($self->{inst}); + my $_pos = $self->{_io}->pos(); + $self->{_io}->seek(0); + $self->{inst} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{inst}}, $self->{_io}->read_u4be(); + } + $self->{_io}->seek($_pos); + return $self->{inst}; +} + +sub a { + my ($self) = @_; + return $self->{a}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatMaxInt.pm b/compiled/perl/ValidFailRepeatMaxInt.pm new file mode 100644 index 000000000..055d1f8cc --- /dev/null +++ b/compiled/perl/ValidFailRepeatMaxInt.pm @@ -0,0 +1,48 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatMaxInt; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{foo} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{foo}}, $self->{_io}->read_u1(); + } +} + +sub foo { + my ($self) = @_; + return $self->{foo}; +} + +1; diff --git a/compiled/perl/ValidFailRepeatMinInt.pm b/compiled/perl/ValidFailRepeatMinInt.pm new file mode 100644 index 000000000..3c231a8df --- /dev/null +++ b/compiled/perl/ValidFailRepeatMinInt.pm @@ -0,0 +1,48 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use strict; +use warnings; +use IO::KaitaiStruct 0.011_000; + +######################################################################## +package ValidFailRepeatMinInt; + +our @ISA = 'IO::KaitaiStruct::Struct'; + +sub from_file { + my ($class, $filename) = @_; + my $fd; + + open($fd, '<', $filename) or return undef; + binmode($fd); + return new($class, IO::KaitaiStruct::Stream->new($fd)); +} + +sub new { + my ($class, $_io, $_parent, $_root) = @_; + my $self = IO::KaitaiStruct::Struct->new($_io); + + bless $self, $class; + $self->{_parent} = $_parent; + $self->{_root} = $_root || $self; + + $self->_read(); + + return $self; +} + +sub _read { + my ($self) = @_; + + $self->{foo} = []; + while (!$self->{_io}->is_eof()) { + push @{$self->{foo}}, $self->{_io}->read_s1(); + } +} + +sub foo { + my ($self) = @_; + return $self->{foo}; +} + +1; diff --git a/compiled/php/FixedContents.php b/compiled/php/FixedContents.php index e8b7ae488..f32519373 100644 --- a/compiled/php/FixedContents.php +++ b/compiled/php/FixedContents.php @@ -10,12 +10,12 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_normal = $this->_io->readBytes(6); - if (!($this->normal() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->normal(), $this->_io(), "/seq/0"); + if (!($this->_m_normal == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m_normal, $this->_io, "/seq/0"); } $this->_m_highBit8 = $this->_io->readBytes(2); - if (!($this->highBit8() == "\xFF\xFF")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\xFF\xFF", $this->highBit8(), $this->_io(), "/seq/1"); + if (!($this->_m_highBit8 == "\xFF\xFF")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\xFF\xFF", $this->_m_highBit8, $this->_io, "/seq/1"); } } protected $_m_normal; diff --git a/compiled/php/FixedStruct.php b/compiled/php/FixedStruct.php index dedf2e6c8..859435013 100644 --- a/compiled/php/FixedStruct.php +++ b/compiled/php/FixedStruct.php @@ -32,49 +32,49 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Tests\Fix private function _read() { $this->_m_magic1 = $this->_io->readBytes(6); - if (!($this->magic1() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->magic1(), $this->_io(), "/types/header/seq/0"); + if (!($this->_m_magic1 == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m_magic1, $this->_io, "/types/header/seq/0"); } $this->_m_uint8 = $this->_io->readU1(); $this->_m_sint8 = $this->_io->readS1(); $this->_m_magicUint = $this->_io->readBytes(10); - if (!($this->magicUint() == "\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", $this->magicUint(), $this->_io(), "/types/header/seq/3"); + if (!($this->_m_magicUint == "\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", $this->_m_magicUint, $this->_io, "/types/header/seq/3"); } $this->_m_uint16 = $this->_io->readU2le(); $this->_m_uint32 = $this->_io->readU4le(); $this->_m_uint64 = $this->_io->readU8le(); $this->_m_magicSint = $this->_io->readBytes(10); - if (!($this->magicSint() == "\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", $this->magicSint(), $this->_io(), "/types/header/seq/7"); + if (!($this->_m_magicSint == "\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", $this->_m_magicSint, $this->_io, "/types/header/seq/7"); } $this->_m_sint16 = $this->_io->readS2le(); $this->_m_sint32 = $this->_io->readS4le(); $this->_m_sint64 = $this->_io->readS8le(); $this->_m_magicUintLe = $this->_io->readBytes(9); - if (!($this->magicUintLe() == "\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", $this->magicUintLe(), $this->_io(), "/types/header/seq/11"); + if (!($this->_m_magicUintLe == "\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", $this->_m_magicUintLe, $this->_io, "/types/header/seq/11"); } $this->_m_uint16le = $this->_io->readU2le(); $this->_m_uint32le = $this->_io->readU4le(); $this->_m_uint64le = $this->_io->readU8le(); $this->_m_magicSintLe = $this->_io->readBytes(9); - if (!($this->magicSintLe() == "\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", $this->magicSintLe(), $this->_io(), "/types/header/seq/15"); + if (!($this->_m_magicSintLe == "\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", $this->_m_magicSintLe, $this->_io, "/types/header/seq/15"); } $this->_m_sint16le = $this->_io->readS2le(); $this->_m_sint32le = $this->_io->readS4le(); $this->_m_sint64le = $this->_io->readS8le(); $this->_m_magicUintBe = $this->_io->readBytes(9); - if (!($this->magicUintBe() == "\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", $this->magicUintBe(), $this->_io(), "/types/header/seq/19"); + if (!($this->_m_magicUintBe == "\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", $this->_m_magicUintBe, $this->_io, "/types/header/seq/19"); } $this->_m_uint16be = $this->_io->readU2be(); $this->_m_uint32be = $this->_io->readU4be(); $this->_m_uint64be = $this->_io->readU8be(); $this->_m_magicSintBe = $this->_io->readBytes(9); - if (!($this->magicSintBe() == "\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", $this->magicSintBe(), $this->_io(), "/types/header/seq/23"); + if (!($this->_m_magicSintBe == "\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", $this->_m_magicSintBe, $this->_io, "/types/header/seq/23"); } $this->_m_sint16be = $this->_io->readS2be(); $this->_m_sint32be = $this->_io->readS4be(); diff --git a/compiled/php/Integers.php b/compiled/php/Integers.php index 4ab4cc15a..7e752c539 100644 --- a/compiled/php/Integers.php +++ b/compiled/php/Integers.php @@ -10,49 +10,49 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_magic1 = $this->_io->readBytes(6); - if (!($this->magic1() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->magic1(), $this->_io(), "/seq/0"); + if (!($this->_m_magic1 == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m_magic1, $this->_io, "/seq/0"); } $this->_m_uint8 = $this->_io->readU1(); $this->_m_sint8 = $this->_io->readS1(); $this->_m_magicUint = $this->_io->readBytes(10); - if (!($this->magicUint() == "\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", $this->magicUint(), $this->_io(), "/seq/3"); + if (!($this->_m_magicUint == "\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x44\x45\x46", $this->_m_magicUint, $this->_io, "/seq/3"); } $this->_m_uint16 = $this->_io->readU2le(); $this->_m_uint32 = $this->_io->readU4le(); $this->_m_uint64 = $this->_io->readU8le(); $this->_m_magicSint = $this->_io->readBytes(10); - if (!($this->magicSint() == "\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", $this->magicSint(), $this->_io(), "/seq/7"); + if (!($this->_m_magicSint == "\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x44\x45\x46", $this->_m_magicSint, $this->_io, "/seq/7"); } $this->_m_sint16 = $this->_io->readS2le(); $this->_m_sint32 = $this->_io->readS4le(); $this->_m_sint64 = $this->_io->readS8le(); $this->_m_magicUintLe = $this->_io->readBytes(9); - if (!($this->magicUintLe() == "\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", $this->magicUintLe(), $this->_io(), "/seq/11"); + if (!($this->_m_magicUintLe == "\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x4C\x45", $this->_m_magicUintLe, $this->_io, "/seq/11"); } $this->_m_uint16le = $this->_io->readU2le(); $this->_m_uint32le = $this->_io->readU4le(); $this->_m_uint64le = $this->_io->readU8le(); $this->_m_magicSintLe = $this->_io->readBytes(9); - if (!($this->magicSintLe() == "\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", $this->magicSintLe(), $this->_io(), "/seq/15"); + if (!($this->_m_magicSintLe == "\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x4C\x45", $this->_m_magicSintLe, $this->_io, "/seq/15"); } $this->_m_sint16le = $this->_io->readS2le(); $this->_m_sint32le = $this->_io->readS4le(); $this->_m_sint64le = $this->_io->readS8le(); $this->_m_magicUintBe = $this->_io->readBytes(9); - if (!($this->magicUintBe() == "\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", $this->magicUintBe(), $this->_io(), "/seq/19"); + if (!($this->_m_magicUintBe == "\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x55\x2D\x42\x45", $this->_m_magicUintBe, $this->_io, "/seq/19"); } $this->_m_uint16be = $this->_io->readU2be(); $this->_m_uint32be = $this->_io->readU4be(); $this->_m_uint64be = $this->_io->readU8be(); $this->_m_magicSintBe = $this->_io->readBytes(9); - if (!($this->magicSintBe() == "\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", $this->magicSintBe(), $this->_io(), "/seq/23"); + if (!($this->_m_magicSintBe == "\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x53\x2D\x42\x45", $this->_m_magicSintBe, $this->_io, "/seq/23"); } $this->_m_sint16be = $this->_io->readS2be(); $this->_m_sint32be = $this->_io->readS4be(); diff --git a/compiled/php/StrPadTermUtf16.php b/compiled/php/StrPadTermUtf16.php new file mode 100644 index 000000000..2737dd038 --- /dev/null +++ b/compiled/php/StrPadTermUtf16.php @@ -0,0 +1,23 @@ +_read(); + } + + private function _read() { + $this->_m_strTerm = \Kaitai\Struct\Stream::bytesToStr(\Kaitai\Struct\Stream::bytesTerminateMulti($this->_io->readBytes(10), "\x00\x00", false), "UTF-16LE"); + $this->_m_strTermInclude = \Kaitai\Struct\Stream::bytesToStr(\Kaitai\Struct\Stream::bytesTerminateMulti($this->_io->readBytes(10), "\x00\x00", true), "UTF-16LE"); + $this->_m_strTermAndPad = \Kaitai\Struct\Stream::bytesToStr(\Kaitai\Struct\Stream::bytesTerminateMulti(\Kaitai\Struct\Stream::bytesStripRight($this->_io->readBytes(9), 43), "\x00\x00", false), "UTF-16LE"); + } + protected $_m_strTerm; + protected $_m_strTermInclude; + protected $_m_strTermAndPad; + public function strTerm() { return $this->_m_strTerm; } + public function strTermInclude() { return $this->_m_strTermInclude; } + public function strTermAndPad() { return $this->_m_strTermAndPad; } + } +} diff --git a/compiled/php/TermStrzUtf16V1.php b/compiled/php/TermStrzUtf16V1.php new file mode 100644 index 000000000..1280e5471 --- /dev/null +++ b/compiled/php/TermStrzUtf16V1.php @@ -0,0 +1,26 @@ +_read(); + } + + private function _read() { + $this->_m_s1 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, true, true), "UTF-16LE"); + $this->_m_s2 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, false, true), "UTF-16LE"); + $this->_m_term = $this->_io->readU2le(); + $this->_m_s3 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", true, true, true), "UTF-16LE"); + } + protected $_m_s1; + protected $_m_s2; + protected $_m_term; + protected $_m_s3; + public function s1() { return $this->_m_s1; } + public function s2() { return $this->_m_s2; } + public function term() { return $this->_m_term; } + public function s3() { return $this->_m_s3; } + } +} diff --git a/compiled/php/TermStrzUtf16V2.php b/compiled/php/TermStrzUtf16V2.php new file mode 100644 index 000000000..0ca660835 --- /dev/null +++ b/compiled/php/TermStrzUtf16V2.php @@ -0,0 +1,23 @@ +_read(); + } + + private function _read() { + $this->_m_s1 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, true, true), "UTF-16LE"); + $this->_m_s2 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", true, true, true), "UTF-16LE"); + $this->_m_s3 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, false, true), "UTF-16LE"); + } + protected $_m_s1; + protected $_m_s2; + protected $_m_s3; + public function s1() { return $this->_m_s1; } + public function s2() { return $this->_m_s2; } + public function s3() { return $this->_m_s3; } + } +} diff --git a/compiled/php/TermStrzUtf16V3.php b/compiled/php/TermStrzUtf16V3.php new file mode 100644 index 000000000..abf1d642d --- /dev/null +++ b/compiled/php/TermStrzUtf16V3.php @@ -0,0 +1,26 @@ +_read(); + } + + private function _read() { + $this->_m_s1 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, false, true), "UTF-16LE"); + $this->_m_term = $this->_io->readU2le(); + $this->_m_s2 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, false, true), "UTF-16LE"); + $this->_m_s3 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, true, true), "UTF-16LE"); + } + protected $_m_s1; + protected $_m_term; + protected $_m_s2; + protected $_m_s3; + public function s1() { return $this->_m_s1; } + public function term() { return $this->_m_term; } + public function s2() { return $this->_m_s2; } + public function s3() { return $this->_m_s3; } + } +} diff --git a/compiled/php/TermStrzUtf16V4.php b/compiled/php/TermStrzUtf16V4.php new file mode 100644 index 000000000..4fae7c894 --- /dev/null +++ b/compiled/php/TermStrzUtf16V4.php @@ -0,0 +1,86 @@ +_read(); + } + + private function _read() { + $this->_m__raw_s1 = $this->_io->readBytes(6); + $_io__raw_s1 = new \Kaitai\Struct\Stream($this->_m__raw_s1); + $this->_m_s1 = new \Kaitai\Struct\Tests\TermStrzUtf16V4\S1Type($_io__raw_s1, $this, $this->_root); + $this->_m_skipTerm1 = $this->_io->readBytes(2); + $this->_m__raw_s2 = $this->_io->readBytes(6); + $_io__raw_s2 = new \Kaitai\Struct\Stream($this->_m__raw_s2); + $this->_m_s2 = new \Kaitai\Struct\Tests\TermStrzUtf16V4\S2Type($_io__raw_s2, $this, $this->_root); + $this->_m_skipTerm2 = $this->_io->readBytes(2); + $this->_m__raw_s3 = $this->_io->readBytes(6); + $_io__raw_s3 = new \Kaitai\Struct\Stream($this->_m__raw_s3); + $this->_m_s3 = new \Kaitai\Struct\Tests\TermStrzUtf16V4\S3Type($_io__raw_s3, $this, $this->_root); + } + protected $_m_s1; + protected $_m_skipTerm1; + protected $_m_s2; + protected $_m_skipTerm2; + protected $_m_s3; + protected $_m__raw_s1; + protected $_m__raw_s2; + protected $_m__raw_s3; + public function s1() { return $this->_m_s1; } + public function skipTerm1() { return $this->_m_skipTerm1; } + public function s2() { return $this->_m_s2; } + public function skipTerm2() { return $this->_m_skipTerm2; } + public function s3() { return $this->_m_s3; } + public function _raw_s1() { return $this->_m__raw_s1; } + public function _raw_s2() { return $this->_m__raw_s2; } + public function _raw_s3() { return $this->_m__raw_s3; } + } +} + +namespace Kaitai\Struct\Tests\TermStrzUtf16V4 { + class S1Type extends \Kaitai\Struct\Struct { + public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_parent = null, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_root = null) { + parent::__construct($_io, $_parent, $_root); + $this->_read(); + } + + private function _read() { + $this->_m_value = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, true, false), "UTF-16LE"); + } + protected $_m_value; + public function value() { return $this->_m_value; } + } +} + +namespace Kaitai\Struct\Tests\TermStrzUtf16V4 { + class S2Type extends \Kaitai\Struct\Struct { + public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_parent = null, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_root = null) { + parent::__construct($_io, $_parent, $_root); + $this->_read(); + } + + private function _read() { + $this->_m_value = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", false, false, false), "UTF-16LE"); + } + protected $_m_value; + public function value() { return $this->_m_value; } + } +} + +namespace Kaitai\Struct\Tests\TermStrzUtf16V4 { + class S3Type extends \Kaitai\Struct\Struct { + public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_parent = null, \Kaitai\Struct\Tests\TermStrzUtf16V4 $_root = null) { + parent::__construct($_io, $_parent, $_root); + $this->_read(); + } + + private function _read() { + $this->_m_value = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytesTermMulti("\x00\x00", true, true, false), "UTF-16LE"); + } + protected $_m_value; + public function value() { return $this->_m_value; } + } +} diff --git a/compiled/php/ValidEqStrEncodings.php b/compiled/php/ValidEqStrEncodings.php index f013ce7f4..33ff2061b 100644 --- a/compiled/php/ValidEqStrEncodings.php +++ b/compiled/php/ValidEqStrEncodings.php @@ -11,23 +11,23 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_lenOf1 = $this->_io->readU2le(); $this->_m_str1 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes($this->lenOf1()), "ASCII"); - if (!($this->str1() == "Some ASCII")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("Some ASCII", $this->str1(), $this->_io(), "/seq/1"); + if (!($this->_m_str1 == "Some ASCII")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("Some ASCII", $this->_m_str1, $this->_io, "/seq/1"); } $this->_m_lenOf2 = $this->_io->readU2le(); $this->_m_str2 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes($this->lenOf2()), "UTF-8"); - if (!($this->str2() == "\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}", $this->str2(), $this->_io(), "/seq/3"); + if (!($this->_m_str2 == "\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}", $this->_m_str2, $this->_io, "/seq/3"); } $this->_m_lenOf3 = $this->_io->readU2le(); $this->_m_str3 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes($this->lenOf3()), "SJIS"); - if (!($this->str3() == "\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}", $this->str3(), $this->_io(), "/seq/5"); + if (!($this->_m_str3 == "\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{3053}\u{3093}\u{306b}\u{3061}\u{306f}", $this->_m_str3, $this->_io, "/seq/5"); } $this->_m_lenOf4 = $this->_io->readU2le(); $this->_m_str4 = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes($this->lenOf4()), "IBM437"); - if (!($this->str4() == "\u{2591}\u{2592}\u{2593}")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{2591}\u{2592}\u{2593}", $this->str4(), $this->_io(), "/seq/7"); + if (!($this->_m_str4 == "\u{2591}\u{2592}\u{2593}")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\u{2591}\u{2592}\u{2593}", $this->_m_str4, $this->_io, "/seq/7"); } } protected $_m_lenOf1; diff --git a/compiled/php/ValidFailAnyofInt.php b/compiled/php/ValidFailAnyofInt.php index 9f9458400..979364a3e 100644 --- a/compiled/php/ValidFailAnyofInt.php +++ b/compiled/php/ValidFailAnyofInt.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - if (!( (($this->foo() == 5) || ($this->foo() == 6) || ($this->foo() == 7) || ($this->foo() == 8) || ($this->foo() == 10) || ($this->foo() == 11) || ($this->foo() == 12) || ($this->foo() == 47)) )) { - throw new \Kaitai\Struct\Error\ValidationNotAnyOfError($this->foo(), $this->_io(), "/seq/0"); + if (!( (($this->_m_foo == 5) || ($this->_m_foo == 6) || ($this->_m_foo == 7) || ($this->_m_foo == 8) || ($this->_m_foo == 10) || ($this->_m_foo == 11) || ($this->_m_foo == 12) || ($this->_m_foo == 47)) )) { + throw new \Kaitai\Struct\Error\ValidationNotAnyOfError($this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailContents.php b/compiled/php/ValidFailContents.php index 74fa0ca18..9a17a2558 100644 --- a/compiled/php/ValidFailContents.php +++ b/compiled/php/ValidFailContents.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readBytes(2); - if (!($this->foo() == "\x51\x41")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x51\x41", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo == "\x51\x41")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x51\x41", $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailEqBytes.php b/compiled/php/ValidFailEqBytes.php index 1b15ef42a..5a5083521 100644 --- a/compiled/php/ValidFailEqBytes.php +++ b/compiled/php/ValidFailEqBytes.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readBytes(2); - if (!($this->foo() == "\x51\x41")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x51\x41", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo == "\x51\x41")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x51\x41", $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailEqInt.php b/compiled/php/ValidFailEqInt.php index 4cd0b0273..efbcb475f 100644 --- a/compiled/php/ValidFailEqInt.php +++ b/compiled/php/ValidFailEqInt.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - if (!($this->foo() == 123)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(123, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo == 123)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(123, $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailEqStr.php b/compiled/php/ValidFailEqStr.php index 49198c386..fb611b971 100644 --- a/compiled/php/ValidFailEqStr.php +++ b/compiled/php/ValidFailEqStr.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(4), "ASCII"); - if (!($this->foo() == "BACK")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("BACK", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo == "BACK")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("BACK", $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailExpr.php b/compiled/php/ValidFailExpr.php index e4794943a..4b12fe438 100644 --- a/compiled/php/ValidFailExpr.php +++ b/compiled/php/ValidFailExpr.php @@ -10,14 +10,14 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - $_ = $this->foo(); + $_ = $this->_m_foo; if (!($_ == 1)) { - throw new \Kaitai\Struct\Error\ValidationExprError($this->foo(), $this->_io(), "/seq/0"); + throw new \Kaitai\Struct\Error\ValidationExprError($this->_m_foo, $this->_io, "/seq/0"); } $this->_m_bar = $this->_io->readS2le(); - $_ = $this->bar(); + $_ = $this->_m_bar; if (!( (($_ < -190) || ($_ > -190)) )) { - throw new \Kaitai\Struct\Error\ValidationExprError($this->bar(), $this->_io(), "/seq/1"); + throw new \Kaitai\Struct\Error\ValidationExprError($this->_m_bar, $this->_io, "/seq/1"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailInst.php b/compiled/php/ValidFailInst.php index d9dd5db08..6e4ce8b3b 100644 --- a/compiled/php/ValidFailInst.php +++ b/compiled/php/ValidFailInst.php @@ -20,10 +20,10 @@ public function inst() { $_pos = $this->_io->pos(); $this->_io->seek(5); $this->_m_inst = $this->_io->readU1(); - $this->_io->seek($_pos); - if (!($this->inst() == 80)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->inst(), $this->_io(), "/instances/inst"); + if (!($this->_m_inst == 80)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->_m_inst, $this->_io, "/instances/inst"); } + $this->_io->seek($_pos); return $this->_m_inst; } protected $_m_a; diff --git a/compiled/php/ValidFailMaxInt.php b/compiled/php/ValidFailMaxInt.php index 91af9f136..f7375c213 100644 --- a/compiled/php/ValidFailMaxInt.php +++ b/compiled/php/ValidFailMaxInt.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - if (!($this->foo() <= 12)) { - throw new \Kaitai\Struct\Error\ValidationGreaterThanError(12, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo <= 12)) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError(12, $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailMinInt.php b/compiled/php/ValidFailMinInt.php index df3227e4b..b916f8f62 100644 --- a/compiled/php/ValidFailMinInt.php +++ b/compiled/php/ValidFailMinInt.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - if (!($this->foo() >= 123)) { - throw new \Kaitai\Struct\Error\ValidationLessThanError(123, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo >= 123)) { + throw new \Kaitai\Struct\Error\ValidationLessThanError(123, $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailRangeBytes.php b/compiled/php/ValidFailRangeBytes.php index a91b14ec9..497a939e9 100644 --- a/compiled/php/ValidFailRangeBytes.php +++ b/compiled/php/ValidFailRangeBytes.php @@ -10,11 +10,11 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readBytes(2); - if (!($this->foo() >= "\x50")) { - throw new \Kaitai\Struct\Error\ValidationLessThanError("\x50", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo >= "\x50")) { + throw new \Kaitai\Struct\Error\ValidationLessThanError("\x50", $this->_m_foo, $this->_io, "/seq/0"); } - if (!($this->foo() <= "\x50\x31")) { - throw new \Kaitai\Struct\Error\ValidationGreaterThanError("\x50\x31", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo <= "\x50\x31")) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError("\x50\x31", $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailRangeFloat.php b/compiled/php/ValidFailRangeFloat.php index abd31f5d5..e8958ff28 100644 --- a/compiled/php/ValidFailRangeFloat.php +++ b/compiled/php/ValidFailRangeFloat.php @@ -10,11 +10,11 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readF4le(); - if (!($this->foo() >= 0.2)) { - throw new \Kaitai\Struct\Error\ValidationLessThanError(0.2, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo >= 0.2)) { + throw new \Kaitai\Struct\Error\ValidationLessThanError(0.2, $this->_m_foo, $this->_io, "/seq/0"); } - if (!($this->foo() <= 0.4)) { - throw new \Kaitai\Struct\Error\ValidationGreaterThanError(0.4, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo <= 0.4)) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError(0.4, $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailRangeInt.php b/compiled/php/ValidFailRangeInt.php index 3befd3189..5ea33f4db 100644 --- a/compiled/php/ValidFailRangeInt.php +++ b/compiled/php/ValidFailRangeInt.php @@ -10,11 +10,11 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = $this->_io->readU1(); - if (!($this->foo() >= 5)) { - throw new \Kaitai\Struct\Error\ValidationLessThanError(5, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo >= 5)) { + throw new \Kaitai\Struct\Error\ValidationLessThanError(5, $this->_m_foo, $this->_io, "/seq/0"); } - if (!($this->foo() <= 10)) { - throw new \Kaitai\Struct\Error\ValidationGreaterThanError(10, $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo <= 10)) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError(10, $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailRangeStr.php b/compiled/php/ValidFailRangeStr.php index 871aa07a3..23a9942a9 100644 --- a/compiled/php/ValidFailRangeStr.php +++ b/compiled/php/ValidFailRangeStr.php @@ -10,11 +10,11 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_foo = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(2), "ASCII"); - if (!($this->foo() >= "P")) { - throw new \Kaitai\Struct\Error\ValidationLessThanError("P", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo >= "P")) { + throw new \Kaitai\Struct\Error\ValidationLessThanError("P", $this->_m_foo, $this->_io, "/seq/0"); } - if (!($this->foo() <= "P1")) { - throw new \Kaitai\Struct\Error\ValidationGreaterThanError("P1", $this->foo(), $this->_io(), "/seq/0"); + if (!($this->_m_foo <= "P1")) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError("P1", $this->_m_foo, $this->_io, "/seq/0"); } } protected $_m_foo; diff --git a/compiled/php/ValidFailRepeatAnyofInt.php b/compiled/php/ValidFailRepeatAnyofInt.php new file mode 100644 index 000000000..9817adca9 --- /dev/null +++ b/compiled/php/ValidFailRepeatAnyofInt.php @@ -0,0 +1,25 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readU1(); + if (!( (($this->_m_foo[$i] == 0) || ($this->_m_foo[$i] == 1) || ($this->_m_foo[$i] == 65)) )) { + throw new \Kaitai\Struct\Error\ValidationNotAnyOfError($this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidFailRepeatContents.php b/compiled/php/ValidFailRepeatContents.php new file mode 100644 index 000000000..e5efbe39d --- /dev/null +++ b/compiled/php/ValidFailRepeatContents.php @@ -0,0 +1,25 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readBytes(4); + if (!($this->_m_foo[$i] == "\x12\x34\x56\x78")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x12\x34\x56\x78", $this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidFailRepeatEqInt.php b/compiled/php/ValidFailRepeatEqInt.php new file mode 100644 index 000000000..b774e3673 --- /dev/null +++ b/compiled/php/ValidFailRepeatEqInt.php @@ -0,0 +1,25 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readU4be(); + if (!($this->_m_foo[$i] == 305419896)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(305419896, $this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidFailRepeatExpr.php b/compiled/php/ValidFailRepeatExpr.php new file mode 100644 index 000000000..e94291b54 --- /dev/null +++ b/compiled/php/ValidFailRepeatExpr.php @@ -0,0 +1,26 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readBytes(4); + $_ = $this->_m_foo[$i]; + if (!($_ != "\x00\x12\x34\x56")) { + throw new \Kaitai\Struct\Error\ValidationExprError($this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidFailRepeatInst.php b/compiled/php/ValidFailRepeatInst.php new file mode 100644 index 000000000..b6c6329ce --- /dev/null +++ b/compiled/php/ValidFailRepeatInst.php @@ -0,0 +1,37 @@ +_read(); + } + + private function _read() { + if (count($this->inst()) == 0) { + $this->_m_a = $this->_io->readBytes(0); + } + } + protected $_m_inst; + public function inst() { + if ($this->_m_inst !== null) + return $this->_m_inst; + $_pos = $this->_io->pos(); + $this->_io->seek(0); + $this->_m_inst = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_inst[] = $this->_io->readU4be(); + if (!($this->_m_inst[$i] == 305419896)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(305419896, $this->_m_inst[$i], $this->_io, "/instances/inst"); + } + $i++; + } + $this->_io->seek($_pos); + return $this->_m_inst; + } + protected $_m_a; + public function a() { return $this->_m_a; } + } +} diff --git a/compiled/php/ValidFailRepeatMaxInt.php b/compiled/php/ValidFailRepeatMaxInt.php new file mode 100644 index 000000000..8c2ef573f --- /dev/null +++ b/compiled/php/ValidFailRepeatMaxInt.php @@ -0,0 +1,25 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readU1(); + if (!($this->_m_foo[$i] <= 254)) { + throw new \Kaitai\Struct\Error\ValidationGreaterThanError(254, $this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidFailRepeatMinInt.php b/compiled/php/ValidFailRepeatMinInt.php new file mode 100644 index 000000000..9bfb5c266 --- /dev/null +++ b/compiled/php/ValidFailRepeatMinInt.php @@ -0,0 +1,25 @@ +_read(); + } + + private function _read() { + $this->_m_foo = []; + $i = 0; + while (!$this->_io->isEof()) { + $this->_m_foo[] = $this->_io->readS1(); + if (!($this->_m_foo[$i] >= 0)) { + throw new \Kaitai\Struct\Error\ValidationLessThanError(0, $this->_m_foo[$i], $this->_io, "/seq/0"); + } + $i++; + } + } + protected $_m_foo; + public function foo() { return $this->_m_foo; } + } +} diff --git a/compiled/php/ValidLong.php b/compiled/php/ValidLong.php index daa5ad3cf..baf20ded7 100644 --- a/compiled/php/ValidLong.php +++ b/compiled/php/ValidLong.php @@ -10,48 +10,48 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_magic1 = $this->_io->readBytes(6); - if (!($this->magic1() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->magic1(), $this->_io(), "/seq/0"); + if (!($this->_m_magic1 == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m_magic1, $this->_io, "/seq/0"); } $this->_m_uint8 = $this->_io->readU1(); - if (!($this->uint8() == 255)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->uint8(), $this->_io(), "/seq/1"); + if (!($this->_m_uint8 == 255)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->_m_uint8, $this->_io, "/seq/1"); } $this->_m_sint8 = $this->_io->readS1(); - if (!($this->sint8() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint8(), $this->_io(), "/seq/2"); + if (!($this->_m_sint8 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint8, $this->_io, "/seq/2"); } $this->_m_magicUint = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(10), "UTF-8"); - if (!($this->magicUint() == "PACK-U-DEF")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-U-DEF", $this->magicUint(), $this->_io(), "/seq/3"); + if (!($this->_m_magicUint == "PACK-U-DEF")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-U-DEF", $this->_m_magicUint, $this->_io, "/seq/3"); } $this->_m_uint16 = $this->_io->readU2le(); - if (!($this->uint16() == 65535)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(65535, $this->uint16(), $this->_io(), "/seq/4"); + if (!($this->_m_uint16 == 65535)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(65535, $this->_m_uint16, $this->_io, "/seq/4"); } $this->_m_uint32 = $this->_io->readU4le(); - if (!($this->uint32() == 4294967295)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(4294967295, $this->uint32(), $this->_io(), "/seq/5"); + if (!($this->_m_uint32 == 4294967295)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(4294967295, $this->_m_uint32, $this->_io, "/seq/5"); } $this->_m_uint64 = $this->_io->readU8le(); - if (!($this->uint64() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->uint64(), $this->_io(), "/seq/6"); + if (!($this->_m_uint64 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_uint64, $this->_io, "/seq/6"); } $this->_m_magicSint = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(10), "UTF-8"); - if (!($this->magicSint() == "PACK-S-DEF")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-S-DEF", $this->magicSint(), $this->_io(), "/seq/7"); + if (!($this->_m_magicSint == "PACK-S-DEF")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-S-DEF", $this->_m_magicSint, $this->_io, "/seq/7"); } $this->_m_sint16 = $this->_io->readS2le(); - if (!($this->sint16() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint16(), $this->_io(), "/seq/8"); + if (!($this->_m_sint16 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint16, $this->_io, "/seq/8"); } $this->_m_sint32 = $this->_io->readS4le(); - if (!($this->sint32() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint32(), $this->_io(), "/seq/9"); + if (!($this->_m_sint32 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint32, $this->_io, "/seq/9"); } $this->_m_sint64 = $this->_io->readS8le(); - if (!($this->sint64() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint64(), $this->_io(), "/seq/10"); + if (!($this->_m_sint64 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint64, $this->_io, "/seq/10"); } } protected $_m_magic1; diff --git a/compiled/php/ValidNotParsedIf.php b/compiled/php/ValidNotParsedIf.php index f47c7c7d0..f24d4e8ce 100644 --- a/compiled/php/ValidNotParsedIf.php +++ b/compiled/php/ValidNotParsedIf.php @@ -11,14 +11,14 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { if (false) { $this->_m_notParsed = $this->_io->readU1(); - if (!($this->notParsed() == 42)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(42, $this->notParsed(), $this->_io(), "/seq/0"); + if (!($this->_m_notParsed == 42)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(42, $this->_m_notParsed, $this->_io, "/seq/0"); } } if (true) { $this->_m_parsed = $this->_io->readU1(); - if (!($this->parsed() == 80)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->parsed(), $this->_io(), "/seq/1"); + if (!($this->_m_parsed == 80)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->_m_parsed, $this->_io, "/seq/1"); } } } diff --git a/compiled/php/ValidOptionalId.php b/compiled/php/ValidOptionalId.php index b1c32e8da..74623244b 100644 --- a/compiled/php/ValidOptionalId.php +++ b/compiled/php/ValidOptionalId.php @@ -10,17 +10,17 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m__unnamed0 = $this->_io->readBytes(6); - if (!($this->_unnamed0() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_unnamed0(), $this->_io(), "/seq/0"); + if (!($this->_m__unnamed0 == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m__unnamed0, $this->_io, "/seq/0"); } $this->_m__unnamed1 = $this->_io->readU1(); - if (!($this->_unnamed1() == 255)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->_unnamed1(), $this->_io(), "/seq/1"); + if (!($this->_m__unnamed1 == 255)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->_m__unnamed1, $this->_io, "/seq/1"); } $this->_m__unnamed2 = $this->_io->readS1(); - $_ = $this->_unnamed2(); + $_ = $this->_m__unnamed2; if (!($_ == -1)) { - throw new \Kaitai\Struct\Error\ValidationExprError($this->_unnamed2(), $this->_io(), "/seq/2"); + throw new \Kaitai\Struct\Error\ValidationExprError($this->_m__unnamed2, $this->_io, "/seq/2"); } } protected $_m__unnamed0; diff --git a/compiled/php/ValidShort.php b/compiled/php/ValidShort.php index 61231481b..747d14c9c 100644 --- a/compiled/php/ValidShort.php +++ b/compiled/php/ValidShort.php @@ -10,48 +10,48 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_magic1 = $this->_io->readBytes(6); - if (!($this->magic1() == "\x50\x41\x43\x4B\x2D\x31")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->magic1(), $this->_io(), "/seq/0"); + if (!($this->_m_magic1 == "\x50\x41\x43\x4B\x2D\x31")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("\x50\x41\x43\x4B\x2D\x31", $this->_m_magic1, $this->_io, "/seq/0"); } $this->_m_uint8 = $this->_io->readU1(); - if (!($this->uint8() == 255)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->uint8(), $this->_io(), "/seq/1"); + if (!($this->_m_uint8 == 255)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(255, $this->_m_uint8, $this->_io, "/seq/1"); } $this->_m_sint8 = $this->_io->readS1(); - if (!($this->sint8() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint8(), $this->_io(), "/seq/2"); + if (!($this->_m_sint8 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint8, $this->_io, "/seq/2"); } $this->_m_magicUint = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(10), "UTF-8"); - if (!($this->magicUint() == "PACK-U-DEF")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-U-DEF", $this->magicUint(), $this->_io(), "/seq/3"); + if (!($this->_m_magicUint == "PACK-U-DEF")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-U-DEF", $this->_m_magicUint, $this->_io, "/seq/3"); } $this->_m_uint16 = $this->_io->readU2le(); - if (!($this->uint16() == 65535)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(65535, $this->uint16(), $this->_io(), "/seq/4"); + if (!($this->_m_uint16 == 65535)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(65535, $this->_m_uint16, $this->_io, "/seq/4"); } $this->_m_uint32 = $this->_io->readU4le(); - if (!($this->uint32() == 4294967295)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(4294967295, $this->uint32(), $this->_io(), "/seq/5"); + if (!($this->_m_uint32 == 4294967295)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(4294967295, $this->_m_uint32, $this->_io, "/seq/5"); } $this->_m_uint64 = $this->_io->readU8le(); - if (!($this->uint64() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->uint64(), $this->_io(), "/seq/6"); + if (!($this->_m_uint64 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_uint64, $this->_io, "/seq/6"); } $this->_m_magicSint = \Kaitai\Struct\Stream::bytesToStr($this->_io->readBytes(10), "UTF-8"); - if (!($this->magicSint() == "PACK-S-DEF")) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-S-DEF", $this->magicSint(), $this->_io(), "/seq/7"); + if (!($this->_m_magicSint == "PACK-S-DEF")) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError("PACK-S-DEF", $this->_m_magicSint, $this->_io, "/seq/7"); } $this->_m_sint16 = $this->_io->readS2le(); - if (!($this->sint16() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint16(), $this->_io(), "/seq/8"); + if (!($this->_m_sint16 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint16, $this->_io, "/seq/8"); } $this->_m_sint32 = $this->_io->readS4le(); - if (!($this->sint32() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint32(), $this->_io(), "/seq/9"); + if (!($this->_m_sint32 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint32, $this->_io, "/seq/9"); } $this->_m_sint64 = $this->_io->readS8le(); - if (!($this->sint64() == -1)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->sint64(), $this->_io(), "/seq/10"); + if (!($this->_m_sint64 == -1)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(-1, $this->_m_sint64, $this->_io, "/seq/10"); } } protected $_m_magic1; diff --git a/compiled/php/ValidSwitch.php b/compiled/php/ValidSwitch.php index ec104455b..54cbbbf06 100644 --- a/compiled/php/ValidSwitch.php +++ b/compiled/php/ValidSwitch.php @@ -10,8 +10,8 @@ public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_ private function _read() { $this->_m_a = $this->_io->readU1(); - if (!($this->a() == 80)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->a(), $this->_io(), "/seq/0"); + if (!($this->_m_a == 80)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(80, $this->_m_a, $this->_io, "/seq/0"); } switch ($this->a()) { case 80: @@ -21,8 +21,8 @@ private function _read() { $this->_m_b = $this->_io->readU2be(); break; } - if (!($this->b() == 17217)) { - throw new \Kaitai\Struct\Error\ValidationNotEqualError(17217, $this->b(), $this->_io(), "/seq/1"); + if (!($this->_m_b == 17217)) { + throw new \Kaitai\Struct\Error\ValidationNotEqualError(17217, $this->_m_b, $this->_io, "/seq/1"); } } protected $_m_a; diff --git a/compiled/python/str_pad_term_utf16.py b/compiled/python/str_pad_term_utf16.py new file mode 100644 index 000000000..7221f3aac --- /dev/null +++ b/compiled/python/str_pad_term_utf16.py @@ -0,0 +1,23 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class StrPadTermUtf16(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.str_term = (KaitaiStream.bytes_terminate_multi(self._io.read_bytes(10), b"\x00\x00", False)).decode(u"UTF-16LE") + self.str_term_include = (KaitaiStream.bytes_terminate_multi(self._io.read_bytes(10), b"\x00\x00", True)).decode(u"UTF-16LE") + self.str_term_and_pad = (KaitaiStream.bytes_terminate_multi(KaitaiStream.bytes_strip_right(self._io.read_bytes(9), 43), b"\x00\x00", False)).decode(u"UTF-16LE") + + diff --git a/compiled/python/term_strz_utf16_v1.py b/compiled/python/term_strz_utf16_v1.py new file mode 100644 index 000000000..a27d035e3 --- /dev/null +++ b/compiled/python/term_strz_utf16_v1.py @@ -0,0 +1,24 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class TermStrzUtf16V1(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.s1 = (self._io.read_bytes_term_multi(b"\x00\x00", False, True, True)).decode(u"UTF-16LE") + self.s2 = (self._io.read_bytes_term_multi(b"\x00\x00", False, False, True)).decode(u"UTF-16LE") + self.term = self._io.read_u2le() + self.s3 = (self._io.read_bytes_term_multi(b"\x00\x00", True, True, True)).decode(u"UTF-16LE") + + diff --git a/compiled/python/term_strz_utf16_v2.py b/compiled/python/term_strz_utf16_v2.py new file mode 100644 index 000000000..ed7a23cd8 --- /dev/null +++ b/compiled/python/term_strz_utf16_v2.py @@ -0,0 +1,23 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class TermStrzUtf16V2(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.s1 = (self._io.read_bytes_term_multi(b"\x00\x00", False, True, True)).decode(u"UTF-16LE") + self.s2 = (self._io.read_bytes_term_multi(b"\x00\x00", True, True, True)).decode(u"UTF-16LE") + self.s3 = (self._io.read_bytes_term_multi(b"\x00\x00", False, False, True)).decode(u"UTF-16LE") + + diff --git a/compiled/python/term_strz_utf16_v3.py b/compiled/python/term_strz_utf16_v3.py new file mode 100644 index 000000000..4eeb132ef --- /dev/null +++ b/compiled/python/term_strz_utf16_v3.py @@ -0,0 +1,24 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class TermStrzUtf16V3(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.s1 = (self._io.read_bytes_term_multi(b"\x00\x00", False, False, True)).decode(u"UTF-16LE") + self.term = self._io.read_u2le() + self.s2 = (self._io.read_bytes_term_multi(b"\x00\x00", False, False, True)).decode(u"UTF-16LE") + self.s3 = (self._io.read_bytes_term_multi(b"\x00\x00", False, True, True)).decode(u"UTF-16LE") + + diff --git a/compiled/python/term_strz_utf16_v4.py b/compiled/python/term_strz_utf16_v4.py new file mode 100644 index 000000000..9ab00de0b --- /dev/null +++ b/compiled/python/term_strz_utf16_v4.py @@ -0,0 +1,64 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class TermStrzUtf16V4(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self._raw_s1 = self._io.read_bytes(6) + _io__raw_s1 = KaitaiStream(BytesIO(self._raw_s1)) + self.s1 = TermStrzUtf16V4.S1Type(_io__raw_s1, self, self._root) + self.skip_term1 = self._io.read_bytes(2) + self._raw_s2 = self._io.read_bytes(6) + _io__raw_s2 = KaitaiStream(BytesIO(self._raw_s2)) + self.s2 = TermStrzUtf16V4.S2Type(_io__raw_s2, self, self._root) + self.skip_term2 = self._io.read_bytes(2) + self._raw_s3 = self._io.read_bytes(6) + _io__raw_s3 = KaitaiStream(BytesIO(self._raw_s3)) + self.s3 = TermStrzUtf16V4.S3Type(_io__raw_s3, self, self._root) + + class S1Type(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root + self._read() + + def _read(self): + self.value = (self._io.read_bytes_term_multi(b"\x00\x00", False, True, False)).decode(u"UTF-16LE") + + + class S2Type(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root + self._read() + + def _read(self): + self.value = (self._io.read_bytes_term_multi(b"\x00\x00", False, False, False)).decode(u"UTF-16LE") + + + class S3Type(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root + self._read() + + def _read(self): + self.value = (self._io.read_bytes_term_multi(b"\x00\x00", True, True, False)).decode(u"UTF-16LE") + + + diff --git a/compiled/python/valid_fail_inst.py b/compiled/python/valid_fail_inst.py index 2fc14350e..11312b3eb 100644 --- a/compiled/python/valid_fail_inst.py +++ b/compiled/python/valid_fail_inst.py @@ -28,9 +28,9 @@ def inst(self): _pos = self._io.pos() self._io.seek(5) self._m_inst = self._io.read_u1() + if not self._m_inst == 80: + raise kaitaistruct.ValidationNotEqualError(80, self._m_inst, self._io, u"/instances/inst") self._io.seek(_pos) - if not self.inst == 80: - raise kaitaistruct.ValidationNotEqualError(80, self.inst, self._io, u"/instances/inst") return getattr(self, '_m_inst', None) diff --git a/compiled/python/valid_fail_repeat_anyof_int.py b/compiled/python/valid_fail_repeat_anyof_int.py new file mode 100644 index 000000000..92a4d69d5 --- /dev/null +++ b/compiled/python/valid_fail_repeat_anyof_int.py @@ -0,0 +1,28 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatAnyofInt(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_u1()) + if not ((self.foo[i] == 0) or (self.foo[i] == 1) or (self.foo[i] == 65)) : + raise kaitaistruct.ValidationNotAnyOfError(self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/python/valid_fail_repeat_contents.py b/compiled/python/valid_fail_repeat_contents.py new file mode 100644 index 000000000..f5139bae9 --- /dev/null +++ b/compiled/python/valid_fail_repeat_contents.py @@ -0,0 +1,28 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatContents(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_bytes(4)) + if not self.foo[i] == b"\x12\x34\x56\x78": + raise kaitaistruct.ValidationNotEqualError(b"\x12\x34\x56\x78", self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/python/valid_fail_repeat_eq_int.py b/compiled/python/valid_fail_repeat_eq_int.py new file mode 100644 index 000000000..bc87d3b87 --- /dev/null +++ b/compiled/python/valid_fail_repeat_eq_int.py @@ -0,0 +1,28 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatEqInt(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_u4be()) + if not self.foo[i] == 305419896: + raise kaitaistruct.ValidationNotEqualError(305419896, self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/python/valid_fail_repeat_expr.py b/compiled/python/valid_fail_repeat_expr.py new file mode 100644 index 000000000..bf6df4b24 --- /dev/null +++ b/compiled/python/valid_fail_repeat_expr.py @@ -0,0 +1,29 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatExpr(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_bytes(4)) + _ = self.foo[i] + if not _ != b"\x00\x12\x34\x56": + raise kaitaistruct.ValidationExprError(self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/python/valid_fail_repeat_inst.py b/compiled/python/valid_fail_repeat_inst.py new file mode 100644 index 000000000..f44e4ac0b --- /dev/null +++ b/compiled/python/valid_fail_repeat_inst.py @@ -0,0 +1,41 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatInst(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + if len(self.inst) == 0: + self.a = self._io.read_bytes(0) + + + @property + def inst(self): + if hasattr(self, '_m_inst'): + return self._m_inst + + _pos = self._io.pos() + self._io.seek(0) + self._m_inst = [] + i = 0 + while not self._io.is_eof(): + self._m_inst.append(self._io.read_u4be()) + if not self._m_inst[i] == 305419896: + raise kaitaistruct.ValidationNotEqualError(305419896, self._m_inst[i], self._io, u"/instances/inst") + i += 1 + + self._io.seek(_pos) + return getattr(self, '_m_inst', None) + + diff --git a/compiled/python/valid_fail_repeat_max_int.py b/compiled/python/valid_fail_repeat_max_int.py new file mode 100644 index 000000000..3deaee984 --- /dev/null +++ b/compiled/python/valid_fail_repeat_max_int.py @@ -0,0 +1,28 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatMaxInt(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_u1()) + if not self.foo[i] <= 254: + raise kaitaistruct.ValidationGreaterThanError(254, self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/python/valid_fail_repeat_min_int.py b/compiled/python/valid_fail_repeat_min_int.py new file mode 100644 index 000000000..c408c8728 --- /dev/null +++ b/compiled/python/valid_fail_repeat_min_int.py @@ -0,0 +1,28 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +# type: ignore + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 11): + raise Exception("Incompatible Kaitai Struct Python API: 0.11 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class ValidFailRepeatMinInt(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.foo = [] + i = 0 + while not self._io.is_eof(): + self.foo.append(self._io.read_s1()) + if not self.foo[i] >= 0: + raise kaitaistruct.ValidationLessThanError(0, self.foo[i], self._io, u"/seq/0") + i += 1 + + + diff --git a/compiled/ruby/fixed_contents.rb b/compiled/ruby/fixed_contents.rb index 02804e08c..2bdb3cfc0 100644 --- a/compiled/ruby/fixed_contents.rb +++ b/compiled/ruby/fixed_contents.rb @@ -14,9 +14,9 @@ def initialize(_io, _parent = nil, _root = nil) def _read @normal = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), normal, _io, "/seq/0") if not normal == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @normal, @_io, "/seq/0") if not @normal == [80, 65, 67, 75, 45, 49].pack('C*') @high_bit_8 = @_io.read_bytes(2) - raise Kaitai::Struct::ValidationNotEqualError.new([255, 255].pack('C*'), high_bit_8, _io, "/seq/1") if not high_bit_8 == [255, 255].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([255, 255].pack('C*'), @high_bit_8, @_io, "/seq/1") if not @high_bit_8 == [255, 255].pack('C*') self end attr_reader :normal diff --git a/compiled/ruby/fixed_struct.rb b/compiled/ruby/fixed_struct.rb index 00d651c52..a8cf07c0f 100644 --- a/compiled/ruby/fixed_struct.rb +++ b/compiled/ruby/fixed_struct.rb @@ -23,36 +23,36 @@ def initialize(_io, _parent = nil, _root = nil) def _read @magic1 = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), magic1, _io, "/types/header/seq/0") if not magic1 == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @magic1, @_io, "/types/header/seq/0") if not @magic1 == [80, 65, 67, 75, 45, 49].pack('C*') @uint8 = @_io.read_u1 @sint8 = @_io.read_s1 @magic_uint = @_io.read_bytes(10) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*'), magic_uint, _io, "/types/header/seq/3") if not magic_uint == [80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*'), @magic_uint, @_io, "/types/header/seq/3") if not @magic_uint == [80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*') @uint16 = @_io.read_u2le @uint32 = @_io.read_u4le @uint64 = @_io.read_u8le @magic_sint = @_io.read_bytes(10) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*'), magic_sint, _io, "/types/header/seq/7") if not magic_sint == [80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*'), @magic_sint, @_io, "/types/header/seq/7") if not @magic_sint == [80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*') @sint16 = @_io.read_s2le @sint32 = @_io.read_s4le @sint64 = @_io.read_s8le @magic_uint_le = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*'), magic_uint_le, _io, "/types/header/seq/11") if not magic_uint_le == [80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*'), @magic_uint_le, @_io, "/types/header/seq/11") if not @magic_uint_le == [80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*') @uint16le = @_io.read_u2le @uint32le = @_io.read_u4le @uint64le = @_io.read_u8le @magic_sint_le = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*'), magic_sint_le, _io, "/types/header/seq/15") if not magic_sint_le == [80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*'), @magic_sint_le, @_io, "/types/header/seq/15") if not @magic_sint_le == [80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*') @sint16le = @_io.read_s2le @sint32le = @_io.read_s4le @sint64le = @_io.read_s8le @magic_uint_be = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*'), magic_uint_be, _io, "/types/header/seq/19") if not magic_uint_be == [80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*'), @magic_uint_be, @_io, "/types/header/seq/19") if not @magic_uint_be == [80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*') @uint16be = @_io.read_u2be @uint32be = @_io.read_u4be @uint64be = @_io.read_u8be @magic_sint_be = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*'), magic_sint_be, _io, "/types/header/seq/23") if not magic_sint_be == [80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*'), @magic_sint_be, @_io, "/types/header/seq/23") if not @magic_sint_be == [80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*') @sint16be = @_io.read_s2be @sint32be = @_io.read_s4be @sint64be = @_io.read_s8be diff --git a/compiled/ruby/integers.rb b/compiled/ruby/integers.rb index a8475874d..157a0c26c 100644 --- a/compiled/ruby/integers.rb +++ b/compiled/ruby/integers.rb @@ -14,36 +14,36 @@ def initialize(_io, _parent = nil, _root = nil) def _read @magic1 = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), magic1, _io, "/seq/0") if not magic1 == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @magic1, @_io, "/seq/0") if not @magic1 == [80, 65, 67, 75, 45, 49].pack('C*') @uint8 = @_io.read_u1 @sint8 = @_io.read_s1 @magic_uint = @_io.read_bytes(10) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*'), magic_uint, _io, "/seq/3") if not magic_uint == [80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*'), @magic_uint, @_io, "/seq/3") if not @magic_uint == [80, 65, 67, 75, 45, 85, 45, 68, 69, 70].pack('C*') @uint16 = @_io.read_u2le @uint32 = @_io.read_u4le @uint64 = @_io.read_u8le @magic_sint = @_io.read_bytes(10) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*'), magic_sint, _io, "/seq/7") if not magic_sint == [80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*'), @magic_sint, @_io, "/seq/7") if not @magic_sint == [80, 65, 67, 75, 45, 83, 45, 68, 69, 70].pack('C*') @sint16 = @_io.read_s2le @sint32 = @_io.read_s4le @sint64 = @_io.read_s8le @magic_uint_le = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*'), magic_uint_le, _io, "/seq/11") if not magic_uint_le == [80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*'), @magic_uint_le, @_io, "/seq/11") if not @magic_uint_le == [80, 65, 67, 75, 45, 85, 45, 76, 69].pack('C*') @uint16le = @_io.read_u2le @uint32le = @_io.read_u4le @uint64le = @_io.read_u8le @magic_sint_le = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*'), magic_sint_le, _io, "/seq/15") if not magic_sint_le == [80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*'), @magic_sint_le, @_io, "/seq/15") if not @magic_sint_le == [80, 65, 67, 75, 45, 83, 45, 76, 69].pack('C*') @sint16le = @_io.read_s2le @sint32le = @_io.read_s4le @sint64le = @_io.read_s8le @magic_uint_be = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*'), magic_uint_be, _io, "/seq/19") if not magic_uint_be == [80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*'), @magic_uint_be, @_io, "/seq/19") if not @magic_uint_be == [80, 65, 67, 75, 45, 85, 45, 66, 69].pack('C*') @uint16be = @_io.read_u2be @uint32be = @_io.read_u4be @uint64be = @_io.read_u8be @magic_sint_be = @_io.read_bytes(9) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*'), magic_sint_be, _io, "/seq/23") if not magic_sint_be == [80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*'), @magic_sint_be, @_io, "/seq/23") if not @magic_sint_be == [80, 65, 67, 75, 45, 83, 45, 66, 69].pack('C*') @sint16be = @_io.read_s2be @sint32be = @_io.read_s4be @sint64be = @_io.read_s8be diff --git a/compiled/ruby/str_pad_term_utf16.rb b/compiled/ruby/str_pad_term_utf16.rb new file mode 100644 index 000000000..9ed353569 --- /dev/null +++ b/compiled/ruby/str_pad_term_utf16.rb @@ -0,0 +1,24 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class StrPadTermUtf16 < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @str_term = (Kaitai::Struct::Stream::bytes_terminate_multi(@_io.read_bytes(10), [0, 0].pack('C*'), false)).force_encoding("UTF-16LE").encode('UTF-8') + @str_term_include = (Kaitai::Struct::Stream::bytes_terminate_multi(@_io.read_bytes(10), [0, 0].pack('C*'), true)).force_encoding("UTF-16LE").encode('UTF-8') + @str_term_and_pad = (Kaitai::Struct::Stream::bytes_terminate_multi(Kaitai::Struct::Stream::bytes_strip_right(@_io.read_bytes(9), 43), [0, 0].pack('C*'), false)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :str_term + attr_reader :str_term_include + attr_reader :str_term_and_pad +end diff --git a/compiled/ruby/term_strz_utf16_v1.rb b/compiled/ruby/term_strz_utf16_v1.rb new file mode 100644 index 000000000..7a0aa4a2d --- /dev/null +++ b/compiled/ruby/term_strz_utf16_v1.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class TermStrzUtf16V1 < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @s1 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, true, true)).force_encoding("UTF-16LE").encode('UTF-8') + @s2 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, false, true)).force_encoding("UTF-16LE").encode('UTF-8') + @term = @_io.read_u2le + @s3 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), true, true, true)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :s1 + attr_reader :s2 + attr_reader :term + attr_reader :s3 +end diff --git a/compiled/ruby/term_strz_utf16_v2.rb b/compiled/ruby/term_strz_utf16_v2.rb new file mode 100644 index 000000000..2c6af3863 --- /dev/null +++ b/compiled/ruby/term_strz_utf16_v2.rb @@ -0,0 +1,24 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class TermStrzUtf16V2 < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @s1 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, true, true)).force_encoding("UTF-16LE").encode('UTF-8') + @s2 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), true, true, true)).force_encoding("UTF-16LE").encode('UTF-8') + @s3 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, false, true)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :s1 + attr_reader :s2 + attr_reader :s3 +end diff --git a/compiled/ruby/term_strz_utf16_v3.rb b/compiled/ruby/term_strz_utf16_v3.rb new file mode 100644 index 000000000..24a0a519f --- /dev/null +++ b/compiled/ruby/term_strz_utf16_v3.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class TermStrzUtf16V3 < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @s1 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, false, true)).force_encoding("UTF-16LE").encode('UTF-8') + @term = @_io.read_u2le + @s2 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, false, true)).force_encoding("UTF-16LE").encode('UTF-8') + @s3 = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, true, true)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :s1 + attr_reader :term + attr_reader :s2 + attr_reader :s3 +end diff --git a/compiled/ruby/term_strz_utf16_v4.rb b/compiled/ruby/term_strz_utf16_v4.rb new file mode 100644 index 000000000..06291e88e --- /dev/null +++ b/compiled/ruby/term_strz_utf16_v4.rb @@ -0,0 +1,70 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class TermStrzUtf16V4 < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + _io_s1 = @_io.substream(6) + @s1 = S1Type.new(_io_s1, self, @_root) + @skip_term1 = @_io.read_bytes(2) + _io_s2 = @_io.substream(6) + @s2 = S2Type.new(_io_s2, self, @_root) + @skip_term2 = @_io.read_bytes(2) + _io_s3 = @_io.substream(6) + @s3 = S3Type.new(_io_s3, self, @_root) + self + end + class S1Type < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root) + _read + end + + def _read + @value = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, true, false)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :value + end + class S2Type < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root) + _read + end + + def _read + @value = (@_io.read_bytes_term_multi([0, 0].pack('C*'), false, false, false)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :value + end + class S3Type < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root) + _read + end + + def _read + @value = (@_io.read_bytes_term_multi([0, 0].pack('C*'), true, true, false)).force_encoding("UTF-16LE").encode('UTF-8') + self + end + attr_reader :value + end + attr_reader :s1 + attr_reader :skip_term1 + attr_reader :s2 + attr_reader :skip_term2 + attr_reader :s3 + attr_reader :_raw_s1 + attr_reader :_raw_s2 + attr_reader :_raw_s3 +end diff --git a/compiled/ruby/valid_eq_str_encodings.rb b/compiled/ruby/valid_eq_str_encodings.rb index 299c750b5..4bc6ad406 100644 --- a/compiled/ruby/valid_eq_str_encodings.rb +++ b/compiled/ruby/valid_eq_str_encodings.rb @@ -15,16 +15,16 @@ def initialize(_io, _parent = nil, _root = nil) def _read @len_of_1 = @_io.read_u2le @str1 = (@_io.read_bytes(len_of_1)).force_encoding("ASCII").encode('UTF-8') - raise Kaitai::Struct::ValidationNotEqualError.new("Some ASCII", str1, _io, "/seq/1") if not str1 == "Some ASCII" + raise Kaitai::Struct::ValidationNotEqualError.new("Some ASCII", @str1, @_io, "/seq/1") if not @str1 == "Some ASCII" @len_of_2 = @_io.read_u2le @str2 = (@_io.read_bytes(len_of_2)).force_encoding("UTF-8") - raise Kaitai::Struct::ValidationNotEqualError.new("\u3053\u3093\u306b\u3061\u306f", str2, _io, "/seq/3") if not str2 == "\u3053\u3093\u306b\u3061\u306f" + raise Kaitai::Struct::ValidationNotEqualError.new("\u3053\u3093\u306b\u3061\u306f", @str2, @_io, "/seq/3") if not @str2 == "\u3053\u3093\u306b\u3061\u306f" @len_of_3 = @_io.read_u2le @str3 = (@_io.read_bytes(len_of_3)).force_encoding("SJIS").encode('UTF-8') - raise Kaitai::Struct::ValidationNotEqualError.new("\u3053\u3093\u306b\u3061\u306f", str3, _io, "/seq/5") if not str3 == "\u3053\u3093\u306b\u3061\u306f" + raise Kaitai::Struct::ValidationNotEqualError.new("\u3053\u3093\u306b\u3061\u306f", @str3, @_io, "/seq/5") if not @str3 == "\u3053\u3093\u306b\u3061\u306f" @len_of_4 = @_io.read_u2le @str4 = (@_io.read_bytes(len_of_4)).force_encoding("IBM437").encode('UTF-8') - raise Kaitai::Struct::ValidationNotEqualError.new("\u2591\u2592\u2593", str4, _io, "/seq/7") if not str4 == "\u2591\u2592\u2593" + raise Kaitai::Struct::ValidationNotEqualError.new("\u2591\u2592\u2593", @str4, @_io, "/seq/7") if not @str4 == "\u2591\u2592\u2593" self end attr_reader :len_of_1 diff --git a/compiled/ruby/valid_fail_anyof_int.rb b/compiled/ruby/valid_fail_anyof_int.rb index 330c37ebc..2816af958 100644 --- a/compiled/ruby/valid_fail_anyof_int.rb +++ b/compiled/ruby/valid_fail_anyof_int.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - raise Kaitai::Struct::ValidationNotAnyOfError.new(foo, _io, "/seq/0") if not ((foo == 5) || (foo == 6) || (foo == 7) || (foo == 8) || (foo == 10) || (foo == 11) || (foo == 12) || (foo == 47)) + raise Kaitai::Struct::ValidationNotAnyOfError.new(@foo, @_io, "/seq/0") if not ((@foo == 5) || (@foo == 6) || (@foo == 7) || (@foo == 8) || (@foo == 10) || (@foo == 11) || (@foo == 12) || (@foo == 47)) self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_contents.rb b/compiled/ruby/valid_fail_contents.rb index 753818eeb..d32e868ea 100644 --- a/compiled/ruby/valid_fail_contents.rb +++ b/compiled/ruby/valid_fail_contents.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_bytes(2) - raise Kaitai::Struct::ValidationNotEqualError.new([81, 65].pack('C*'), foo, _io, "/seq/0") if not foo == [81, 65].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([81, 65].pack('C*'), @foo, @_io, "/seq/0") if not @foo == [81, 65].pack('C*') self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_eq_bytes.rb b/compiled/ruby/valid_fail_eq_bytes.rb index bac369772..b669c83b4 100644 --- a/compiled/ruby/valid_fail_eq_bytes.rb +++ b/compiled/ruby/valid_fail_eq_bytes.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_bytes(2) - raise Kaitai::Struct::ValidationNotEqualError.new([81, 65].pack('C*'), foo, _io, "/seq/0") if not foo == [81, 65].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([81, 65].pack('C*'), @foo, @_io, "/seq/0") if not @foo == [81, 65].pack('C*') self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_eq_int.rb b/compiled/ruby/valid_fail_eq_int.rb index 3b86122f3..0c40c88c8 100644 --- a/compiled/ruby/valid_fail_eq_int.rb +++ b/compiled/ruby/valid_fail_eq_int.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(123, foo, _io, "/seq/0") if not foo == 123 + raise Kaitai::Struct::ValidationNotEqualError.new(123, @foo, @_io, "/seq/0") if not @foo == 123 self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_eq_str.rb b/compiled/ruby/valid_fail_eq_str.rb index e4a365dc8..6505b6c58 100644 --- a/compiled/ruby/valid_fail_eq_str.rb +++ b/compiled/ruby/valid_fail_eq_str.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = (@_io.read_bytes(4)).force_encoding("ASCII").encode('UTF-8') - raise Kaitai::Struct::ValidationNotEqualError.new("BACK", foo, _io, "/seq/0") if not foo == "BACK" + raise Kaitai::Struct::ValidationNotEqualError.new("BACK", @foo, @_io, "/seq/0") if not @foo == "BACK" self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_expr.rb b/compiled/ruby/valid_fail_expr.rb index 0d409e4dd..3ec142d5b 100644 --- a/compiled/ruby/valid_fail_expr.rb +++ b/compiled/ruby/valid_fail_expr.rb @@ -14,11 +14,11 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - _ = foo - raise Kaitai::Struct::ValidationExprError.new(foo, _io, "/seq/0") if not _ == 1 + _ = @foo + raise Kaitai::Struct::ValidationExprError.new(@foo, @_io, "/seq/0") if not _ == 1 @bar = @_io.read_s2le - _ = bar - raise Kaitai::Struct::ValidationExprError.new(bar, _io, "/seq/1") if not ((_ < -190) || (_ > -190)) + _ = @bar + raise Kaitai::Struct::ValidationExprError.new(@bar, @_io, "/seq/1") if not ((_ < -190) || (_ > -190)) self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_inst.rb b/compiled/ruby/valid_fail_inst.rb index 9d3c63bd8..77f04991c 100644 --- a/compiled/ruby/valid_fail_inst.rb +++ b/compiled/ruby/valid_fail_inst.rb @@ -23,8 +23,8 @@ def inst _pos = @_io.pos @_io.seek(5) @inst = @_io.read_u1 + raise Kaitai::Struct::ValidationNotEqualError.new(80, @inst, @_io, "/instances/inst") if not @inst == 80 @_io.seek(_pos) - raise Kaitai::Struct::ValidationNotEqualError.new(80, inst, _io, "/instances/inst") if not inst == 80 @inst end attr_reader :a diff --git a/compiled/ruby/valid_fail_max_int.rb b/compiled/ruby/valid_fail_max_int.rb index 3a29f8cb6..8f058d4cf 100644 --- a/compiled/ruby/valid_fail_max_int.rb +++ b/compiled/ruby/valid_fail_max_int.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - raise Kaitai::Struct::ValidationGreaterThanError.new(12, foo, _io, "/seq/0") if not foo <= 12 + raise Kaitai::Struct::ValidationGreaterThanError.new(12, @foo, @_io, "/seq/0") if not @foo <= 12 self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_min_int.rb b/compiled/ruby/valid_fail_min_int.rb index 7c0e50445..bf2994c61 100644 --- a/compiled/ruby/valid_fail_min_int.rb +++ b/compiled/ruby/valid_fail_min_int.rb @@ -14,7 +14,7 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - raise Kaitai::Struct::ValidationLessThanError.new(123, foo, _io, "/seq/0") if not foo >= 123 + raise Kaitai::Struct::ValidationLessThanError.new(123, @foo, @_io, "/seq/0") if not @foo >= 123 self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_range_bytes.rb b/compiled/ruby/valid_fail_range_bytes.rb index 3bd55aba2..471d8d720 100644 --- a/compiled/ruby/valid_fail_range_bytes.rb +++ b/compiled/ruby/valid_fail_range_bytes.rb @@ -14,8 +14,8 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_bytes(2) - raise Kaitai::Struct::ValidationLessThanError.new([80].pack('C*'), foo, _io, "/seq/0") if not foo >= [80].pack('C*') - raise Kaitai::Struct::ValidationGreaterThanError.new([80, 49].pack('C*'), foo, _io, "/seq/0") if not foo <= [80, 49].pack('C*') + raise Kaitai::Struct::ValidationLessThanError.new([80].pack('C*'), @foo, @_io, "/seq/0") if not @foo >= [80].pack('C*') + raise Kaitai::Struct::ValidationGreaterThanError.new([80, 49].pack('C*'), @foo, @_io, "/seq/0") if not @foo <= [80, 49].pack('C*') self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_range_float.rb b/compiled/ruby/valid_fail_range_float.rb index e7ef0723e..c64507f3c 100644 --- a/compiled/ruby/valid_fail_range_float.rb +++ b/compiled/ruby/valid_fail_range_float.rb @@ -14,8 +14,8 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_f4le - raise Kaitai::Struct::ValidationLessThanError.new(0.2, foo, _io, "/seq/0") if not foo >= 0.2 - raise Kaitai::Struct::ValidationGreaterThanError.new(0.4, foo, _io, "/seq/0") if not foo <= 0.4 + raise Kaitai::Struct::ValidationLessThanError.new(0.2, @foo, @_io, "/seq/0") if not @foo >= 0.2 + raise Kaitai::Struct::ValidationGreaterThanError.new(0.4, @foo, @_io, "/seq/0") if not @foo <= 0.4 self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_range_int.rb b/compiled/ruby/valid_fail_range_int.rb index 39e89aa6b..dc6193a12 100644 --- a/compiled/ruby/valid_fail_range_int.rb +++ b/compiled/ruby/valid_fail_range_int.rb @@ -14,8 +14,8 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = @_io.read_u1 - raise Kaitai::Struct::ValidationLessThanError.new(5, foo, _io, "/seq/0") if not foo >= 5 - raise Kaitai::Struct::ValidationGreaterThanError.new(10, foo, _io, "/seq/0") if not foo <= 10 + raise Kaitai::Struct::ValidationLessThanError.new(5, @foo, @_io, "/seq/0") if not @foo >= 5 + raise Kaitai::Struct::ValidationGreaterThanError.new(10, @foo, @_io, "/seq/0") if not @foo <= 10 self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_range_str.rb b/compiled/ruby/valid_fail_range_str.rb index 21daf1861..926322ab3 100644 --- a/compiled/ruby/valid_fail_range_str.rb +++ b/compiled/ruby/valid_fail_range_str.rb @@ -14,8 +14,8 @@ def initialize(_io, _parent = nil, _root = nil) def _read @foo = (@_io.read_bytes(2)).force_encoding("ASCII").encode('UTF-8') - raise Kaitai::Struct::ValidationLessThanError.new("P", foo, _io, "/seq/0") if not foo >= "P" - raise Kaitai::Struct::ValidationGreaterThanError.new("P1", foo, _io, "/seq/0") if not foo <= "P1" + raise Kaitai::Struct::ValidationLessThanError.new("P", @foo, @_io, "/seq/0") if not @foo >= "P" + raise Kaitai::Struct::ValidationGreaterThanError.new("P1", @foo, @_io, "/seq/0") if not @foo <= "P1" self end attr_reader :foo diff --git a/compiled/ruby/valid_fail_repeat_anyof_int.rb b/compiled/ruby/valid_fail_repeat_anyof_int.rb new file mode 100644 index 000000000..310158e78 --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_anyof_int.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatAnyofInt < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_u1 + raise Kaitai::Struct::ValidationNotAnyOfError.new(@foo[i], @_io, "/seq/0") if not ((@foo[i] == 0) || (@foo[i] == 1) || (@foo[i] == 65)) + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_fail_repeat_contents.rb b/compiled/ruby/valid_fail_repeat_contents.rb new file mode 100644 index 000000000..a44850f9f --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_contents.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatContents < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_bytes(4) + raise Kaitai::Struct::ValidationNotEqualError.new([18, 52, 86, 120].pack('C*'), @foo[i], @_io, "/seq/0") if not @foo[i] == [18, 52, 86, 120].pack('C*') + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_fail_repeat_eq_int.rb b/compiled/ruby/valid_fail_repeat_eq_int.rb new file mode 100644 index 000000000..7c28f254b --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_eq_int.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatEqInt < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_u4be + raise Kaitai::Struct::ValidationNotEqualError.new(305419896, @foo[i], @_io, "/seq/0") if not @foo[i] == 305419896 + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_fail_repeat_expr.rb b/compiled/ruby/valid_fail_repeat_expr.rb new file mode 100644 index 000000000..422c3d6b3 --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_expr.rb @@ -0,0 +1,27 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatExpr < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_bytes(4) + _ = @foo[i] + raise Kaitai::Struct::ValidationExprError.new(@foo[i], @_io, "/seq/0") if not _ != [0, 18, 52, 86].pack('C*') + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_fail_repeat_inst.rb b/compiled/ruby/valid_fail_repeat_inst.rb new file mode 100644 index 000000000..d39c8f604 --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_inst.rb @@ -0,0 +1,36 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatInst < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + if inst.length == 0 + @a = @_io.read_bytes(0) + end + self + end + def inst + return @inst unless @inst.nil? + _pos = @_io.pos + @_io.seek(0) + @inst = [] + i = 0 + while not @_io.eof? + @inst << @_io.read_u4be + raise Kaitai::Struct::ValidationNotEqualError.new(305419896, @inst[i], @_io, "/instances/inst") if not @inst[i] == 305419896 + i += 1 + end + @_io.seek(_pos) + @inst + end + attr_reader :a +end diff --git a/compiled/ruby/valid_fail_repeat_max_int.rb b/compiled/ruby/valid_fail_repeat_max_int.rb new file mode 100644 index 000000000..8fcc48379 --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_max_int.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatMaxInt < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_u1 + raise Kaitai::Struct::ValidationGreaterThanError.new(254, @foo[i], @_io, "/seq/0") if not @foo[i] <= 254 + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_fail_repeat_min_int.rb b/compiled/ruby/valid_fail_repeat_min_int.rb new file mode 100644 index 000000000..89111e392 --- /dev/null +++ b/compiled/ruby/valid_fail_repeat_min_int.rb @@ -0,0 +1,26 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +require 'kaitai/struct/struct' + +unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.11') + raise "Incompatible Kaitai Struct Ruby API: 0.11 or later is required, but you have #{Kaitai::Struct::VERSION}" +end + +class ValidFailRepeatMinInt < Kaitai::Struct::Struct + def initialize(_io, _parent = nil, _root = nil) + super(_io, _parent, _root || self) + _read + end + + def _read + @foo = [] + i = 0 + while not @_io.eof? + @foo << @_io.read_s1 + raise Kaitai::Struct::ValidationLessThanError.new(0, @foo[i], @_io, "/seq/0") if not @foo[i] >= 0 + i += 1 + end + self + end + attr_reader :foo +end diff --git a/compiled/ruby/valid_long.rb b/compiled/ruby/valid_long.rb index 698a50d59..db360dc4c 100644 --- a/compiled/ruby/valid_long.rb +++ b/compiled/ruby/valid_long.rb @@ -14,27 +14,27 @@ def initialize(_io, _parent = nil, _root = nil) def _read @magic1 = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), magic1, _io, "/seq/0") if not magic1 == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @magic1, @_io, "/seq/0") if not @magic1 == [80, 65, 67, 75, 45, 49].pack('C*') @uint8 = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(255, uint8, _io, "/seq/1") if not uint8 == 255 + raise Kaitai::Struct::ValidationNotEqualError.new(255, @uint8, @_io, "/seq/1") if not @uint8 == 255 @sint8 = @_io.read_s1 - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint8, _io, "/seq/2") if not sint8 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint8, @_io, "/seq/2") if not @sint8 == -1 @magic_uint = (@_io.read_bytes(10)).force_encoding("UTF-8") - raise Kaitai::Struct::ValidationNotEqualError.new("PACK-U-DEF", magic_uint, _io, "/seq/3") if not magic_uint == "PACK-U-DEF" + raise Kaitai::Struct::ValidationNotEqualError.new("PACK-U-DEF", @magic_uint, @_io, "/seq/3") if not @magic_uint == "PACK-U-DEF" @uint16 = @_io.read_u2le - raise Kaitai::Struct::ValidationNotEqualError.new(65535, uint16, _io, "/seq/4") if not uint16 == 65535 + raise Kaitai::Struct::ValidationNotEqualError.new(65535, @uint16, @_io, "/seq/4") if not @uint16 == 65535 @uint32 = @_io.read_u4le - raise Kaitai::Struct::ValidationNotEqualError.new(4294967295, uint32, _io, "/seq/5") if not uint32 == 4294967295 + raise Kaitai::Struct::ValidationNotEqualError.new(4294967295, @uint32, @_io, "/seq/5") if not @uint32 == 4294967295 @uint64 = @_io.read_u8le - raise Kaitai::Struct::ValidationNotEqualError.new(18446744073709551615, uint64, _io, "/seq/6") if not uint64 == 18446744073709551615 + raise Kaitai::Struct::ValidationNotEqualError.new(18446744073709551615, @uint64, @_io, "/seq/6") if not @uint64 == 18446744073709551615 @magic_sint = (@_io.read_bytes(10)).force_encoding("UTF-8") - raise Kaitai::Struct::ValidationNotEqualError.new("PACK-S-DEF", magic_sint, _io, "/seq/7") if not magic_sint == "PACK-S-DEF" + raise Kaitai::Struct::ValidationNotEqualError.new("PACK-S-DEF", @magic_sint, @_io, "/seq/7") if not @magic_sint == "PACK-S-DEF" @sint16 = @_io.read_s2le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint16, _io, "/seq/8") if not sint16 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint16, @_io, "/seq/8") if not @sint16 == -1 @sint32 = @_io.read_s4le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint32, _io, "/seq/9") if not sint32 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint32, @_io, "/seq/9") if not @sint32 == -1 @sint64 = @_io.read_s8le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint64, _io, "/seq/10") if not sint64 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint64, @_io, "/seq/10") if not @sint64 == -1 self end attr_reader :magic1 diff --git a/compiled/ruby/valid_not_parsed_if.rb b/compiled/ruby/valid_not_parsed_if.rb index 27c9f118d..2c6a8957c 100644 --- a/compiled/ruby/valid_not_parsed_if.rb +++ b/compiled/ruby/valid_not_parsed_if.rb @@ -15,11 +15,11 @@ def initialize(_io, _parent = nil, _root = nil) def _read if false @not_parsed = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(42, not_parsed, _io, "/seq/0") if not not_parsed == 42 + raise Kaitai::Struct::ValidationNotEqualError.new(42, @not_parsed, @_io, "/seq/0") if not @not_parsed == 42 end if true @parsed = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(80, parsed, _io, "/seq/1") if not parsed == 80 + raise Kaitai::Struct::ValidationNotEqualError.new(80, @parsed, @_io, "/seq/1") if not @parsed == 80 end self end diff --git a/compiled/ruby/valid_optional_id.rb b/compiled/ruby/valid_optional_id.rb index 398ed119e..6de8ea8ca 100644 --- a/compiled/ruby/valid_optional_id.rb +++ b/compiled/ruby/valid_optional_id.rb @@ -14,12 +14,12 @@ def initialize(_io, _parent = nil, _root = nil) def _read @_unnamed0 = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), _unnamed0, _io, "/seq/0") if not _unnamed0 == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @_unnamed0, @_io, "/seq/0") if not @_unnamed0 == [80, 65, 67, 75, 45, 49].pack('C*') @_unnamed1 = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(255, _unnamed1, _io, "/seq/1") if not _unnamed1 == 255 + raise Kaitai::Struct::ValidationNotEqualError.new(255, @_unnamed1, @_io, "/seq/1") if not @_unnamed1 == 255 @_unnamed2 = @_io.read_s1 - _ = _unnamed2 - raise Kaitai::Struct::ValidationExprError.new(_unnamed2, _io, "/seq/2") if not _ == -1 + _ = @_unnamed2 + raise Kaitai::Struct::ValidationExprError.new(@_unnamed2, @_io, "/seq/2") if not _ == -1 self end attr_reader :_unnamed0 diff --git a/compiled/ruby/valid_short.rb b/compiled/ruby/valid_short.rb index a3837fdd2..098f64aef 100644 --- a/compiled/ruby/valid_short.rb +++ b/compiled/ruby/valid_short.rb @@ -14,27 +14,27 @@ def initialize(_io, _parent = nil, _root = nil) def _read @magic1 = @_io.read_bytes(6) - raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), magic1, _io, "/seq/0") if not magic1 == [80, 65, 67, 75, 45, 49].pack('C*') + raise Kaitai::Struct::ValidationNotEqualError.new([80, 65, 67, 75, 45, 49].pack('C*'), @magic1, @_io, "/seq/0") if not @magic1 == [80, 65, 67, 75, 45, 49].pack('C*') @uint8 = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(255, uint8, _io, "/seq/1") if not uint8 == 255 + raise Kaitai::Struct::ValidationNotEqualError.new(255, @uint8, @_io, "/seq/1") if not @uint8 == 255 @sint8 = @_io.read_s1 - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint8, _io, "/seq/2") if not sint8 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint8, @_io, "/seq/2") if not @sint8 == -1 @magic_uint = (@_io.read_bytes(10)).force_encoding("UTF-8") - raise Kaitai::Struct::ValidationNotEqualError.new("PACK-U-DEF", magic_uint, _io, "/seq/3") if not magic_uint == "PACK-U-DEF" + raise Kaitai::Struct::ValidationNotEqualError.new("PACK-U-DEF", @magic_uint, @_io, "/seq/3") if not @magic_uint == "PACK-U-DEF" @uint16 = @_io.read_u2le - raise Kaitai::Struct::ValidationNotEqualError.new(65535, uint16, _io, "/seq/4") if not uint16 == 65535 + raise Kaitai::Struct::ValidationNotEqualError.new(65535, @uint16, @_io, "/seq/4") if not @uint16 == 65535 @uint32 = @_io.read_u4le - raise Kaitai::Struct::ValidationNotEqualError.new(4294967295, uint32, _io, "/seq/5") if not uint32 == 4294967295 + raise Kaitai::Struct::ValidationNotEqualError.new(4294967295, @uint32, @_io, "/seq/5") if not @uint32 == 4294967295 @uint64 = @_io.read_u8le - raise Kaitai::Struct::ValidationNotEqualError.new(18446744073709551615, uint64, _io, "/seq/6") if not uint64 == 18446744073709551615 + raise Kaitai::Struct::ValidationNotEqualError.new(18446744073709551615, @uint64, @_io, "/seq/6") if not @uint64 == 18446744073709551615 @magic_sint = (@_io.read_bytes(10)).force_encoding("UTF-8") - raise Kaitai::Struct::ValidationNotEqualError.new("PACK-S-DEF", magic_sint, _io, "/seq/7") if not magic_sint == "PACK-S-DEF" + raise Kaitai::Struct::ValidationNotEqualError.new("PACK-S-DEF", @magic_sint, @_io, "/seq/7") if not @magic_sint == "PACK-S-DEF" @sint16 = @_io.read_s2le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint16, _io, "/seq/8") if not sint16 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint16, @_io, "/seq/8") if not @sint16 == -1 @sint32 = @_io.read_s4le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint32, _io, "/seq/9") if not sint32 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint32, @_io, "/seq/9") if not @sint32 == -1 @sint64 = @_io.read_s8le - raise Kaitai::Struct::ValidationNotEqualError.new(-1, sint64, _io, "/seq/10") if not sint64 == -1 + raise Kaitai::Struct::ValidationNotEqualError.new(-1, @sint64, @_io, "/seq/10") if not @sint64 == -1 self end attr_reader :magic1 diff --git a/compiled/ruby/valid_switch.rb b/compiled/ruby/valid_switch.rb index b846fde9c..bc070bd4e 100644 --- a/compiled/ruby/valid_switch.rb +++ b/compiled/ruby/valid_switch.rb @@ -14,14 +14,14 @@ def initialize(_io, _parent = nil, _root = nil) def _read @a = @_io.read_u1 - raise Kaitai::Struct::ValidationNotEqualError.new(80, a, _io, "/seq/0") if not a == 80 + raise Kaitai::Struct::ValidationNotEqualError.new(80, @a, @_io, "/seq/0") if not @a == 80 case a when 80 @b = @_io.read_u2le else @b = @_io.read_u2be end - raise Kaitai::Struct::ValidationNotEqualError.new(17217, b, _io, "/seq/1") if not b == 17217 + raise Kaitai::Struct::ValidationNotEqualError.new(17217, @b, @_io, "/seq/1") if not @b == 17217 self end attr_reader :a diff --git a/compiled/rust/str_pad_term_utf16.rs b/compiled/rust/str_pad_term_utf16.rs new file mode 100644 index 000000000..b359c07c0 --- /dev/null +++ b/compiled/rust/str_pad_term_utf16.rs @@ -0,0 +1,47 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct StrPadTermUtf16 { + pub strTerm: String, + pub strTermInclude: String, + pub strTermAndPad: String, +} + +impl KaitaiStruct for StrPadTermUtf16 { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.strTerm = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.strTermInclude = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.strTermAndPad = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl StrPadTermUtf16 { +} diff --git a/compiled/rust/term_strz_utf16_v1.rs b/compiled/rust/term_strz_utf16_v1.rs new file mode 100644 index 000000000..0a90c9241 --- /dev/null +++ b/compiled/rust/term_strz_utf16_v1.rs @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct TermStrzUtf16V1 { + pub s1: String, + pub s2: String, + pub term: u16, + pub s3: String, +} + +impl KaitaiStruct for TermStrzUtf16V1 { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.s1 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.s2 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.term = self.stream.read_u2le()?; + self.s3 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V1 { +} diff --git a/compiled/rust/term_strz_utf16_v2.rs b/compiled/rust/term_strz_utf16_v2.rs new file mode 100644 index 000000000..6e1cdd178 --- /dev/null +++ b/compiled/rust/term_strz_utf16_v2.rs @@ -0,0 +1,47 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct TermStrzUtf16V2 { + pub s1: String, + pub s2: String, + pub s3: String, +} + +impl KaitaiStruct for TermStrzUtf16V2 { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.s1 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.s2 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.s3 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V2 { +} diff --git a/compiled/rust/term_strz_utf16_v3.rs b/compiled/rust/term_strz_utf16_v3.rs new file mode 100644 index 000000000..4aec5ed73 --- /dev/null +++ b/compiled/rust/term_strz_utf16_v3.rs @@ -0,0 +1,49 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct TermStrzUtf16V3 { + pub s1: String, + pub term: u16, + pub s2: String, + pub s3: String, +} + +impl KaitaiStruct for TermStrzUtf16V3 { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.s1 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.term = self.stream.read_u2le()?; + self.s2 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + self.s3 = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V3 { +} diff --git a/compiled/rust/term_strz_utf16_v4.rs b/compiled/rust/term_strz_utf16_v4.rs new file mode 100644 index 000000000..e8c7c369a --- /dev/null +++ b/compiled/rust/term_strz_utf16_v4.rs @@ -0,0 +1,156 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct TermStrzUtf16V4 { + pub s1: Box, + pub skipTerm1: Vec, + pub s2: Box, + pub skipTerm2: Vec, + pub s3: Box, + pub _raw_s1: Vec, + pub _raw_s2: Vec, + pub _raw_s3: Vec, +} + +impl KaitaiStruct for TermStrzUtf16V4 { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self._raw_s1 = self.stream.read_bytes(6)?; + let mut io = Cursor::new(self._raw_s1); + self.s1 = Box::new(TermStrzUtf16V4__S1Type::new(self.stream, self, _root)?); + self.skipTerm1 = self.stream.read_bytes(2)?; + self._raw_s2 = self.stream.read_bytes(6)?; + let mut io = Cursor::new(self._raw_s2); + self.s2 = Box::new(TermStrzUtf16V4__S2Type::new(self.stream, self, _root)?); + self.skipTerm2 = self.stream.read_bytes(2)?; + self._raw_s3 = self.stream.read_bytes(6)?; + let mut io = Cursor::new(self._raw_s3); + self.s3 = Box::new(TermStrzUtf16V4__S3Type::new(self.stream, self, _root)?); + } +} + +impl TermStrzUtf16V4 { +} +#[derive(Default)] +pub struct TermStrzUtf16V4__S1Type { + pub value: String, +} + +impl KaitaiStruct for TermStrzUtf16V4__S1Type { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.value = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V4__S1Type { +} +#[derive(Default)] +pub struct TermStrzUtf16V4__S2Type { + pub value: String, +} + +impl KaitaiStruct for TermStrzUtf16V4__S2Type { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.value = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V4__S2Type { +} +#[derive(Default)] +pub struct TermStrzUtf16V4__S3Type { + pub value: String, +} + +impl KaitaiStruct for TermStrzUtf16V4__S3Type { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.value = panic!("Unimplemented encoding for bytesToStr: {}", "UTF-16LE"); + } +} + +impl TermStrzUtf16V4__S3Type { +} diff --git a/compiled/rust/valid_fail_repeat_anyof_int.rs b/compiled/rust/valid_fail_repeat_anyof_int.rs new file mode 100644 index 000000000..40f7f6417 --- /dev/null +++ b/compiled/rust/valid_fail_repeat_anyof_int.rs @@ -0,0 +1,46 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatAnyofInt { + pub foo: Vec, +} + +impl KaitaiStruct for ValidFailRepeatAnyofInt { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.foo = vec!(); + while !self.stream.isEof() { + self.foo.append(self.stream.read_u1()?); + } + } +} + +impl ValidFailRepeatAnyofInt { +} diff --git a/compiled/rust/valid_fail_repeat_contents.rs b/compiled/rust/valid_fail_repeat_contents.rs new file mode 100644 index 000000000..1d128cd2f --- /dev/null +++ b/compiled/rust/valid_fail_repeat_contents.rs @@ -0,0 +1,46 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatContents { + pub foo: Vec>, +} + +impl KaitaiStruct for ValidFailRepeatContents { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.foo = vec!(); + while !self.stream.isEof() { + self.foo.append(self.stream.read_bytes(4)?); + } + } +} + +impl ValidFailRepeatContents { +} diff --git a/compiled/rust/valid_fail_repeat_eq_int.rs b/compiled/rust/valid_fail_repeat_eq_int.rs new file mode 100644 index 000000000..da5b7912f --- /dev/null +++ b/compiled/rust/valid_fail_repeat_eq_int.rs @@ -0,0 +1,46 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatEqInt { + pub foo: Vec, +} + +impl KaitaiStruct for ValidFailRepeatEqInt { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.foo = vec!(); + while !self.stream.isEof() { + self.foo.append(self.stream.read_u4be()?); + } + } +} + +impl ValidFailRepeatEqInt { +} diff --git a/compiled/rust/valid_fail_repeat_inst.rs b/compiled/rust/valid_fail_repeat_inst.rs new file mode 100644 index 000000000..de10e1624 --- /dev/null +++ b/compiled/rust/valid_fail_repeat_inst.rs @@ -0,0 +1,60 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatInst { + pub a: Vec, + pub inst: Option>, +} + +impl KaitaiStruct for ValidFailRepeatInst { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + if self.inst.len() == 0 { + self.a = self.stream.read_bytes(0)?; + } + } +} + +impl ValidFailRepeatInst { + fn inst(&mut self) -> Vec { + if let Some(x) = self.inst { + return x; + } + + let _pos = self.stream.pos(); + self.stream.seek(0); + self.inst = vec!(); + while !self.stream.isEof() { + self.inst.append(self.stream.read_u4be()?); + } + self.stream.seek(_pos); + return self.inst; + } +} diff --git a/compiled/rust/valid_fail_repeat_max_int.rs b/compiled/rust/valid_fail_repeat_max_int.rs new file mode 100644 index 000000000..14d768df0 --- /dev/null +++ b/compiled/rust/valid_fail_repeat_max_int.rs @@ -0,0 +1,46 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatMaxInt { + pub foo: Vec, +} + +impl KaitaiStruct for ValidFailRepeatMaxInt { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.foo = vec!(); + while !self.stream.isEof() { + self.foo.append(self.stream.read_u1()?); + } + } +} + +impl ValidFailRepeatMaxInt { +} diff --git a/compiled/rust/valid_fail_repeat_min_int.rs b/compiled/rust/valid_fail_repeat_min_int.rs new file mode 100644 index 000000000..5197c6ad1 --- /dev/null +++ b/compiled/rust/valid_fail_repeat_min_int.rs @@ -0,0 +1,46 @@ +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +use std::option::Option; +use std::boxed::Box; +use std::io::Result; +use std::io::Cursor; +use std::vec::Vec; +use std::default::Default; +use kaitai_struct::KaitaiStream; +use kaitai_struct::KaitaiStruct; + +#[derive(Default)] +pub struct ValidFailRepeatMinInt { + pub foo: Vec, +} + +impl KaitaiStruct for ValidFailRepeatMinInt { + fn new(stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result + where Self: Sized { + let mut s: Self = Default::default(); + + s.stream = stream; + s.read(stream, _parent, _root)?; + + Ok(s) + } + + + fn read(&mut self, + stream: &mut S, + _parent: &Option>, + _root: &Option>) + -> Result<()> + where Self: Sized { + self.foo = vec!(); + while !self.stream.isEof() { + self.foo.append(self.stream.read_s1()?); + } + } +} + +impl ValidFailRepeatMinInt { +}