Pol  Revision:4b29d2b
uop.h
Go to the documentation of this file.
1 #ifndef UOP_H_
2 #define UOP_H_
3 
4 // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
5 
6 #include "kaitai/kaitaistruct.h"
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 #if KAITAI_STRUCT_VERSION < 7000L
12 #error "Incompatible Kaitai Struct C++/STL API: version 0.7 or later is required"
13 #endif
14 
15 class uop_t : public kaitai::kstruct {
16 
17 public:
18  class block_addr_t;
19  class block_body_t;
20  class data_header_v5_t;
21  class header_t;
22  class file_t;
23 
27  };
28 
29  uop_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, uop_t* p__root = 0);
30 
31 private:
32  void _read();
33 
34 public:
35  ~uop_t();
36 
37  class block_addr_t : public kaitai::kstruct {
38 
39  public:
40 
41  block_addr_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, uop_t* p__root = 0);
42 
43  private:
44  void _read();
45 
46  public:
47  ~block_addr_t();
48 
49  private:
53 
54  public:
56 
57  private:
58 
59  public:
61 
62  private:
63  uint64_t m_blockaddr;
65  kaitai::kstruct* m__parent;
66 
67  public:
68  uint64_t blockaddr() const { return m_blockaddr; }
69  uop_t* _root() const { return m__root; }
70  kaitai::kstruct* _parent() const { return m__parent; }
71  };
72 
73  class block_body_t : public kaitai::kstruct {
74 
75  public:
76 
77  block_body_t(kaitai::kstream* p__io, uop_t::block_addr_t* p__parent = 0,
78  uop_t* p__root = 0);
79 
80  private:
81  void _read();
82 
83  public:
84  ~block_body_t();
85 
86  private:
87  uint32_t m_nfiles;
89  std::vector<file_t*>* m_files;
92 
93  public:
94  uint32_t nfiles() const { return m_nfiles; }
95  block_addr_t* next_addr() const { return m_next_addr; }
96  std::vector<file_t*>* files() const { return m_files; }
97  uop_t* _root() const { return m__root; }
98  uop_t::block_addr_t* _parent() const { return m__parent; }
99  };
100 
101  class data_header_v5_t : public kaitai::kstruct {
102 
103  public:
104 
105  data_header_v5_t(kaitai::kstream* p__io, uop_t::file_t* p__parent = 0, uop_t* p__root = 0);
106 
107  private:
108  void _read();
109 
110  public:
111  ~data_header_v5_t();
112 
113  private:
114  std::string m_bytes;
115  std::string m_filebytes;
118 
119  public:
120  std::string bytes() const { return m_bytes; }
121  std::string filebytes() const { return m_filebytes; }
122  uop_t* _root() const { return m__root; }
123  uop_t::file_t* _parent() const { return m__parent; }
124  };
125 
126  class header_t : public kaitai::kstruct {
127 
128  public:
129 
130  header_t(kaitai::kstream* p__io, uop_t* p__parent = 0, uop_t* p__root = 0);
131 
132  private:
133  void _read();
134 
135  public:
136  ~header_t();
137 
138  private:
139  std::string m_magic;
140  std::string m_version;
141  std::string m_signature;
144  uint32_t m_nfiles;
147 
148  public:
149  std::string magic() const { return m_magic; }
150  std::string version() const { return m_version; }
151  std::string signature() const { return m_signature; }
152  block_addr_t* firstblock() const { return m_firstblock; }
153  uint32_t maxfiles_per_block() const { return m_maxfiles_per_block; }
154  uint32_t nfiles() const { return m_nfiles; }
155  uop_t* _root() const { return m__root; }
156  uop_t* _parent() const { return m__parent; }
157  };
158 
159  class file_t : public kaitai::kstruct {
160 
161  public:
162 
163  file_t(kaitai::kstream* p__io, uop_t::block_body_t* p__parent = 0, uop_t* p__root = 0);
164 
165  private:
166  void _read();
167 
168  public:
169  ~file_t();
170 
171  private:
172  bool f_data;
174  bool n_data;
175 
176  public:
177  bool _is_null_data() { data(); return n_data; };
178 
179  private:
180 
181  public:
183 
184  private:
185  uint64_t m_dataaddr;
186  uint32_t m_file_len;
189  uint64_t m_filehash;
190  uint32_t m_adler32;
194  std::string m__raw_data;
195  kaitai::kstream* m__io__raw_data;
196 
197  public:
198  uint64_t dataaddr() const { return m_dataaddr; }
199  uint32_t file_len() const { return m_file_len; }
200  uint32_t compressed_size() const { return m_compressed_size; }
201  uint32_t decompressed_size() const { return m_decompressed_size; }
202  uint64_t filehash() const { return m_filehash; }
203  uint32_t adler32() const { return m_adler32; }
204  compression_type_t compression_type() const { return m_compression_type; }
205  uop_t* _root() const { return m__root; }
206  uop_t::block_body_t* _parent() const { return m__parent; }
207  std::string _raw_data() const { return m__raw_data; }
208  kaitai::kstream* _io__raw_data() const { return m__io__raw_data; }
209  };
210 
211 private:
214  kaitai::kstruct* m__parent;
215 
216 public:
217  header_t* header() const { return m_header; }
218  uop_t* _root() const { return m__root; }
219  kaitai::kstruct* _parent() const { return m__parent; }
220 };
221 
222 #endif // UOP_H_
uint32_t m_decompressed_size
Definition: uop.h:188
uint32_t m_compressed_size
Definition: uop.h:187
uint32_t compressed_size() const
Definition: uop.h:200
void _read()
Definition: uop.cpp:14
std::string bytes() const
Definition: uop.h:120
bool _is_null_block_body()
Definition: uop.h:55
Definition: uop.h:15
uop_t * m__root
Definition: uop.h:90
bool f_data
Definition: uop.h:172
kaitai::kstream * _io__raw_data() const
Definition: uop.h:208
uop_t::file_t * m__parent
Definition: uop.h:117
kaitai::kstruct * m__parent
Definition: uop.h:214
std::vector< file_t * > * m_files
Definition: uop.h:89
uop_t(kaitai::kstream *p__io, kaitai::kstruct *p__parent=0, uop_t *p__root=0)
Definition: uop.cpp:7
uop_t * _root() const
Definition: uop.h:218
bool n_block_body
Definition: uop.h:52
uop_t::block_addr_t * m__parent
Definition: uop.h:91
std::string version() const
Definition: uop.h:150
uop_t::block_body_t * m__parent
Definition: uop.h:193
uop_t * _root() const
Definition: uop.h:155
bool _is_null_data()
Definition: uop.h:177
uop_t * _root() const
Definition: uop.h:205
compression_type_t
Definition: uop.h:24
std::string m__raw_data
Definition: uop.h:194
uop_t::file_t * _parent() const
Definition: uop.h:123
std::string m_filebytes
Definition: uop.h:115
std::string magic() const
Definition: uop.h:149
block_addr_t * next_addr() const
Definition: uop.h:95
compression_type_t compression_type() const
Definition: uop.h:204
uint32_t file_len() const
Definition: uop.h:199
compression_type_t m_compression_type
Definition: uop.h:191
uop_t * _root() const
Definition: uop.h:69
std::string filebytes() const
Definition: uop.h:121
uint32_t decompressed_size() const
Definition: uop.h:201
block_addr_t(kaitai::kstream *p__io, kaitai::kstruct *p__parent=0, uop_t *p__root=0)
Definition: uop.cpp:22
uint32_t nfiles() const
Definition: uop.h:94
uop_t * _root() const
Definition: uop.h:122
std::string m_magic
Definition: uop.h:139
std::vector< file_t * > * files() const
Definition: uop.h:96
uint64_t m_blockaddr
Definition: uop.h:63
uint32_t m_file_len
Definition: uop.h:186
uop_t::block_addr_t * _parent() const
Definition: uop.h:98
uop_t * m__root
Definition: uop.h:213
void _read()
Definition: uop.cpp:30
uint64_t filehash() const
Definition: uop.h:202
uint32_t m_nfiles
Definition: uop.h:144
uop_t::block_body_t * _parent() const
Definition: uop.h:206
block_addr_t * m_firstblock
Definition: uop.h:142
uint64_t m_dataaddr
Definition: uop.h:185
uop_t * m__root
Definition: uop.h:192
uop_t * _root() const
Definition: uop.h:97
header_t * m_header
Definition: uop.h:212
uint32_t m_maxfiles_per_block
Definition: uop.h:143
std::string _raw_data() const
Definition: uop.h:207
std::string signature() const
Definition: uop.h:151
uop_t * m__root
Definition: uop.h:145
uop_t * m__parent
Definition: uop.h:146
uint32_t m_adler32
Definition: uop.h:190
std::string m_signature
Definition: uop.h:141
std::unordered_map< u64, ScriptDiffData > data
Definition: osmod.cpp:966
std::string m_version
Definition: uop.h:140
block_addr_t * m_next_addr
Definition: uop.h:88
~uop_t()
Definition: uop.cpp:18
kaitai::kstruct * m__parent
Definition: uop.h:65
uop_t * _parent() const
Definition: uop.h:156
uint64_t dataaddr() const
Definition: uop.h:198
uint64_t blockaddr() const
Definition: uop.h:68
std::string m_bytes
Definition: uop.h:114
block_body_t * block_body()
Definition: uop.cpp:40
bool f_block_body
Definition: uop.h:50
bool n_data
Definition: uop.h:174
block_addr_t * firstblock() const
Definition: uop.h:152
uint32_t maxfiles_per_block() const
Definition: uop.h:153
kaitai::kstruct * _parent() const
Definition: uop.h:219
kaitai::kstruct * _parent() const
Definition: uop.h:70
uop_t * m__root
Definition: uop.h:64
uint32_t nfiles() const
Definition: uop.h:154
uint64_t m_filehash
Definition: uop.h:189
block_body_t * m_block_body
Definition: uop.h:51
data_header_v5_t * m_data
Definition: uop.h:173
header_t * header() const
Definition: uop.h:217
kaitai::kstream * m__io__raw_data
Definition: uop.h:195
uint32_t adler32() const
Definition: uop.h:203
uint32_t m_nfiles
Definition: uop.h:87