11// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
22
33#include " rekordbox_pdb.h"
4-
54#include " kaitai/exceptions.h"
65
76rekordbox_pdb_t ::rekordbox_pdb_t (kaitai::kstream* p__io, kaitai::kstruct* p__parent, rekordbox_pdb_t * p__root) : kaitai::kstruct(p__io) {
@@ -20,14 +19,9 @@ void rekordbox_pdb_t::_read() {
2019 m_sequence = m__io->read_u4le ();
2120 m_gap = m__io->read_bytes (4 );
2221 if (!(gap () == std::string (" \x00\x00\x00\x00 " , 4 ))) {
23- throw kaitai::validation_not_equal_error<std::string>(
24- std::string (" \x00\x00\x00\x00 " , 4 ),
25- gap (),
26- _io (),
27- std::string (" /seq/6" ));
22+ throw kaitai::validation_not_equal_error<std::string>(std::string (" \x00\x00\x00\x00 " , 4 ), gap (), _io (), std::string (" /seq/6" ));
2823 }
29- m_tables = std::unique_ptr<std::vector<std::unique_ptr<table_t >>>(
30- new std::vector<std::unique_ptr<table_t >>());
24+ m_tables = std::unique_ptr<std::vector<std::unique_ptr<table_t >>>(new std::vector<std::unique_ptr<table_t >>());
3125 const int l_tables = num_tables ();
3226 for (int i = 0 ; i < l_tables; i++) {
3327 m_tables->push_back (std::move (std::unique_ptr<table_t >(new table_t (m__io, this , m__root))));
@@ -51,19 +45,15 @@ void rekordbox_pdb_t::device_sql_string_t::_read() {
5145 m_length_and_kind = m__io->read_u1 ();
5246 switch (length_and_kind ()) {
5347 case 64 : {
54- m_body = std::unique_ptr<device_sql_long_ascii_t >(
55- new device_sql_long_ascii_t (m__io, this , m__root));
48+ m_body = std::unique_ptr<device_sql_long_ascii_t >(new device_sql_long_ascii_t (m__io, this , m__root));
5649 break ;
5750 }
5851 case 144 : {
59- m_body = std::unique_ptr<device_sql_long_utf16le_t >(
60- new device_sql_long_utf16le_t (m__io, this , m__root));
52+ m_body = std::unique_ptr<device_sql_long_utf16le_t >(new device_sql_long_utf16le_t (m__io, this , m__root));
6153 break ;
6254 }
6355 default : {
64- m_body = std::unique_ptr<device_sql_short_ascii_t >(
65- new device_sql_short_ascii_t (
66- length_and_kind (), m__io, this , m__root));
56+ m_body = std::unique_ptr<device_sql_short_ascii_t >(new device_sql_short_ascii_t (length_and_kind (), m__io, this , m__root));
6757 break ;
6858 }
6959 }
@@ -76,11 +66,7 @@ rekordbox_pdb_t::device_sql_string_t::~device_sql_string_t() {
7666void rekordbox_pdb_t::device_sql_string_t::_clean_up () {
7767}
7868
79- rekordbox_pdb_t ::history_playlist_row_t ::history_playlist_row_t (
80- kaitai::kstream* p__io,
81- rekordbox_pdb_t ::row_ref_t * p__parent,
82- rekordbox_pdb_t * p__root)
83- : kaitai::kstruct(p__io) {
69+ rekordbox_pdb_t ::history_playlist_row_t ::history_playlist_row_t (kaitai::kstream* p__io, rekordbox_pdb_t ::row_ref_t * p__parent, rekordbox_pdb_t * p__root) : kaitai::kstruct(p__io) {
8470 m__parent = p__parent;
8571 m__root = p__root;
8672 m_name = nullptr ;
@@ -152,12 +138,7 @@ rekordbox_pdb_t::color_row_t::~color_row_t() {
152138void rekordbox_pdb_t::color_row_t::_clean_up () {
153139}
154140
155- rekordbox_pdb_t ::device_sql_short_ascii_t ::device_sql_short_ascii_t (
156- uint8_t p_length_and_kind,
157- kaitai::kstream* p__io,
158- rekordbox_pdb_t ::device_sql_string_t * p__parent,
159- rekordbox_pdb_t * p__root)
160- : kaitai::kstruct(p__io) {
141+ rekordbox_pdb_t ::device_sql_short_ascii_t ::device_sql_short_ascii_t (uint8_t p_length_and_kind, kaitai::kstream* p__io, rekordbox_pdb_t ::device_sql_string_t * p__parent, rekordbox_pdb_t * p__root) : kaitai::kstruct(p__io) {
161142 m__parent = p__parent;
162143 m__root = p__root;
163144 m_length_and_kind = p_length_and_kind;
@@ -239,11 +220,7 @@ rekordbox_pdb_t::page_t::page_t(kaitai::kstream* p__io, rekordbox_pdb_t::page_re
239220void rekordbox_pdb_t::page_t::_read () {
240221 m_gap = m__io->read_bytes (4 );
241222 if (!(gap () == std::string (" \x00\x00\x00\x00 " , 4 ))) {
242- throw kaitai::validation_not_equal_error<std::string>(
243- std::string (" \x00\x00\x00\x00 " , 4 ),
244- gap (),
245- _io (),
246- std::string (" /types/page/seq/0" ));
223+ throw kaitai::validation_not_equal_error<std::string>(std::string (" \x00\x00\x00\x00 " , 4 ), gap (), _io (), std::string (" /types/page/seq/0" ));
247224 }
248225 m_page_index = m__io->read_u4le ();
249226 m_type = static_cast <rekordbox_pdb_t ::page_type_t >(m__io->read_u4le ());
@@ -300,13 +277,10 @@ std::vector<std::unique_ptr<rekordbox_pdb_t::row_group_t>>* rekordbox_pdb_t::pag
300277 n_row_groups = true ;
301278 if (is_data_page ()) {
302279 n_row_groups = false ;
303- m_row_groups =
304- std::unique_ptr<std::vector<std::unique_ptr<row_group_t >>>(
305- new std::vector<std::unique_ptr<row_group_t >>());
280+ m_row_groups = std::unique_ptr<std::vector<std::unique_ptr<row_group_t >>>(new std::vector<std::unique_ptr<row_group_t >>());
306281 const int l_row_groups = num_row_groups ();
307282 for (int i = 0 ; i < l_row_groups; i++) {
308- m_row_groups->push_back (std::move (std::unique_ptr<row_group_t >(
309- new row_group_t (i, m__io, this , m__root))));
283+ m_row_groups->push_back (std::move (std::unique_ptr<row_group_t >(new row_group_t (i, m__io, this , m__root))));
310284 }
311285 f_row_groups = true ;
312286 }
@@ -376,15 +350,10 @@ uint16_t rekordbox_pdb_t::row_group_t::row_present_flags() {
376350std::vector<std::unique_ptr<rekordbox_pdb_t ::row_ref_t >>* rekordbox_pdb_t::row_group_t::rows () {
377351 if (f_rows)
378352 return m_rows.get ();
379- m_rows = std::unique_ptr<std::vector<std::unique_ptr<row_ref_t >>>(
380- new std::vector<std::unique_ptr<row_ref_t >>());
381- const int l_rows = ((group_index () < (_parent ()->num_row_groups () - 1 ))
382- ? (16 )
383- : ((kaitai::kstream::mod ((_parent ()->num_rows () - 1 ), 16 ) +
384- 1 )));
353+ m_rows = std::unique_ptr<std::vector<std::unique_ptr<row_ref_t >>>(new std::vector<std::unique_ptr<row_ref_t >>());
354+ const int l_rows = 16 ;
385355 for (int i = 0 ; i < l_rows; i++) {
386- m_rows->push_back (std::move (std::unique_ptr<row_ref_t >(
387- new row_ref_t (i, m__io, this , m__root))));
356+ m_rows->push_back (std::move (std::unique_ptr<row_ref_t >(new row_ref_t (i, m__io, this , m__root))));
388357 }
389358 f_rows = true ;
390359 return m_rows.get ();
@@ -409,11 +378,7 @@ rekordbox_pdb_t::genre_row_t::~genre_row_t() {
409378void rekordbox_pdb_t::genre_row_t::_clean_up () {
410379}
411380
412- rekordbox_pdb_t ::history_entry_row_t ::history_entry_row_t (
413- kaitai::kstream* p__io,
414- rekordbox_pdb_t ::row_ref_t * p__parent,
415- rekordbox_pdb_t * p__root)
416- : kaitai::kstruct(p__io) {
381+ rekordbox_pdb_t ::history_entry_row_t ::history_entry_row_t (kaitai::kstream* p__io, rekordbox_pdb_t ::row_ref_t * p__parent, rekordbox_pdb_t * p__root) : kaitai::kstruct(p__io) {
417382 m__parent = p__parent;
418383 m__root = p__root;
419384 _read ();
@@ -702,8 +667,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
702667 return m_unknown_string_8.get ();
703668 std::streampos _pos = m__io->pos ();
704669 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (18 )));
705- m_unknown_string_8 = std::unique_ptr<device_sql_string_t >(
706- new device_sql_string_t (m__io, this , m__root));
670+ m_unknown_string_8 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
707671 m__io->seek (_pos);
708672 f_unknown_string_8 = true ;
709673 return m_unknown_string_8.get ();
@@ -714,8 +678,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
714678 return m_unknown_string_6.get ();
715679 std::streampos _pos = m__io->pos ();
716680 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (9 )));
717- m_unknown_string_6 = std::unique_ptr<device_sql_string_t >(
718- new device_sql_string_t (m__io, this , m__root));
681+ m_unknown_string_6 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
719682 m__io->seek (_pos);
720683 f_unknown_string_6 = true ;
721684 return m_unknown_string_6.get ();
@@ -726,8 +689,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::analyze_date
726689 return m_analyze_date.get ();
727690 std::streampos _pos = m__io->pos ();
728691 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (15 )));
729- m_analyze_date = std::unique_ptr<device_sql_string_t >(
730- new device_sql_string_t (m__io, this , m__root));
692+ m_analyze_date = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
731693 m__io->seek (_pos);
732694 f_analyze_date = true ;
733695 return m_analyze_date.get ();
@@ -738,8 +700,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::file_path()
738700 return m_file_path.get ();
739701 std::streampos _pos = m__io->pos ();
740702 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (20 )));
741- m_file_path = std::unique_ptr<device_sql_string_t >(
742- new device_sql_string_t (m__io, this , m__root));
703+ m_file_path = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
743704 m__io->seek (_pos);
744705 f_file_path = true ;
745706 return m_file_path.get ();
@@ -750,8 +711,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::date_added()
750711 return m_date_added.get ();
751712 std::streampos _pos = m__io->pos ();
752713 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (10 )));
753- m_date_added = std::unique_ptr<device_sql_string_t >(
754- new device_sql_string_t (m__io, this , m__root));
714+ m_date_added = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
755715 m__io->seek (_pos);
756716 f_date_added = true ;
757717 return m_date_added.get ();
@@ -762,8 +722,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
762722 return m_unknown_string_3.get ();
763723 std::streampos _pos = m__io->pos ();
764724 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (3 )));
765- m_unknown_string_3 = std::unique_ptr<device_sql_string_t >(
766- new device_sql_string_t (m__io, this , m__root));
725+ m_unknown_string_3 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
767726 m__io->seek (_pos);
768727 f_unknown_string_3 = true ;
769728 return m_unknown_string_3.get ();
@@ -785,8 +744,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::kuvo_public(
785744 return m_kuvo_public.get ();
786745 std::streampos _pos = m__io->pos ();
787746 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (6 )));
788- m_kuvo_public = std::unique_ptr<device_sql_string_t >(
789- new device_sql_string_t (m__io, this , m__root));
747+ m_kuvo_public = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
790748 m__io->seek (_pos);
791749 f_kuvo_public = true ;
792750 return m_kuvo_public.get ();
@@ -797,8 +755,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::mix_name() {
797755 return m_mix_name.get ();
798756 std::streampos _pos = m__io->pos ();
799757 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (12 )));
800- m_mix_name = std::unique_ptr<device_sql_string_t >(
801- new device_sql_string_t (m__io, this , m__root));
758+ m_mix_name = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
802759 m__io->seek (_pos);
803760 f_mix_name = true ;
804761 return m_mix_name.get ();
@@ -809,8 +766,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
809766 return m_unknown_string_5.get ();
810767 std::streampos _pos = m__io->pos ();
811768 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (8 )));
812- m_unknown_string_5 = std::unique_ptr<device_sql_string_t >(
813- new device_sql_string_t (m__io, this , m__root));
769+ m_unknown_string_5 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
814770 m__io->seek (_pos);
815771 f_unknown_string_5 = true ;
816772 return m_unknown_string_5.get ();
@@ -821,8 +777,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
821777 return m_unknown_string_4.get ();
822778 std::streampos _pos = m__io->pos ();
823779 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (4 )));
824- m_unknown_string_4 = std::unique_ptr<device_sql_string_t >(
825- new device_sql_string_t (m__io, this , m__root));
780+ m_unknown_string_4 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
826781 m__io->seek (_pos);
827782 f_unknown_string_4 = true ;
828783 return m_unknown_string_4.get ();
@@ -844,8 +799,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
844799 return m_unknown_string_2.get ();
845800 std::streampos _pos = m__io->pos ();
846801 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (2 )));
847- m_unknown_string_2 = std::unique_ptr<device_sql_string_t >(
848- new device_sql_string_t (m__io, this , m__root));
802+ m_unknown_string_2 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
849803 m__io->seek (_pos);
850804 f_unknown_string_2 = true ;
851805 return m_unknown_string_2.get ();
@@ -867,8 +821,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::unknown_stri
867821 return m_unknown_string_7.get ();
868822 std::streampos _pos = m__io->pos ();
869823 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (13 )));
870- m_unknown_string_7 = std::unique_ptr<device_sql_string_t >(
871- new device_sql_string_t (m__io, this , m__root));
824+ m_unknown_string_7 = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
872825 m__io->seek (_pos);
873826 f_unknown_string_7 = true ;
874827 return m_unknown_string_7.get ();
@@ -879,8 +832,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::filename() {
879832 return m_filename.get ();
880833 std::streampos _pos = m__io->pos ();
881834 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (19 )));
882- m_filename = std::unique_ptr<device_sql_string_t >(
883- new device_sql_string_t (m__io, this , m__root));
835+ m_filename = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
884836 m__io->seek (_pos);
885837 f_filename = true ;
886838 return m_filename.get ();
@@ -891,8 +843,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::analyze_path
891843 return m_analyze_path.get ();
892844 std::streampos _pos = m__io->pos ();
893845 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (14 )));
894- m_analyze_path = std::unique_ptr<device_sql_string_t >(
895- new device_sql_string_t (m__io, this , m__root));
846+ m_analyze_path = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
896847 m__io->seek (_pos);
897848 f_analyze_path = true ;
898849 return m_analyze_path.get ();
@@ -914,8 +865,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::release_date
914865 return m_release_date.get ();
915866 std::streampos _pos = m__io->pos ();
916867 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (11 )));
917- m_release_date = std::unique_ptr<device_sql_string_t >(
918- new device_sql_string_t (m__io, this , m__root));
868+ m_release_date = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
919869 m__io->seek (_pos);
920870 f_release_date = true ;
921871 return m_release_date.get ();
@@ -926,8 +876,7 @@ rekordbox_pdb_t::device_sql_string_t* rekordbox_pdb_t::track_row_t::autoload_hot
926876 return m_autoload_hot_cues.get ();
927877 std::streampos _pos = m__io->pos ();
928878 m__io->seek ((_parent ()->row_base () + ofs_strings ()->at (7 )));
929- m_autoload_hot_cues = std::unique_ptr<device_sql_string_t >(
930- new device_sql_string_t (m__io, this , m__root));
879+ m_autoload_hot_cues = std::unique_ptr<device_sql_string_t >(new device_sql_string_t (m__io, this , m__root));
931880 m__io->seek (_pos);
932881 f_autoload_hot_cues = true ;
933882 return m_autoload_hot_cues.get ();
@@ -1002,11 +951,7 @@ rekordbox_pdb_t::label_row_t::~label_row_t() {
1002951void rekordbox_pdb_t::label_row_t::_clean_up () {
1003952}
1004953
1005- rekordbox_pdb_t ::device_sql_long_utf16le_t ::device_sql_long_utf16le_t (
1006- kaitai::kstream* p__io,
1007- rekordbox_pdb_t ::device_sql_string_t * p__parent,
1008- rekordbox_pdb_t * p__root)
1009- : kaitai::kstruct(p__io) {
954+ rekordbox_pdb_t ::device_sql_long_utf16le_t ::device_sql_long_utf16le_t (kaitai::kstream* p__io, rekordbox_pdb_t ::device_sql_string_t * p__parent, rekordbox_pdb_t * p__root) : kaitai::kstruct(p__io) {
1010955 m__parent = p__parent;
1011956 m__root = p__root;
1012957 _read ();
@@ -1015,8 +960,7 @@ rekordbox_pdb_t::device_sql_long_utf16le_t::device_sql_long_utf16le_t(
1015960void rekordbox_pdb_t::device_sql_long_utf16le_t::_read () {
1016961 m_length = m__io->read_u2le ();
1017962 m__unnamed1 = m__io->read_u1 ();
1018- m_text = kaitai::kstream::bytes_to_str (
1019- m__io->read_bytes ((length () - 4 )), std::string (" UTF-16LE" ));
963+ m_text = kaitai::kstream::bytes_to_str (m__io->read_bytes ((length () - 4 )), std::string (" UTF-16LE" ));
1020964}
1021965
1022966rekordbox_pdb_t ::device_sql_long_utf16le_t ::~device_sql_long_utf16le_t () {
@@ -1112,8 +1056,7 @@ kaitai::kstruct* rekordbox_pdb_t::row_ref_t::body() {
11121056 switch (_parent ()->_parent ()->type ()) {
11131057 case rekordbox_pdb_t ::PAGE_TYPE_PLAYLIST_TREE : {
11141058 n_body = false ;
1115- m_body = std::unique_ptr<playlist_tree_row_t >(
1116- new playlist_tree_row_t (m__io, this , m__root));
1059+ m_body = std::unique_ptr<playlist_tree_row_t >(new playlist_tree_row_t (m__io, this , m__root));
11171060 break ;
11181061 }
11191062 case rekordbox_pdb_t ::PAGE_TYPE_KEYS : {
@@ -1138,8 +1081,7 @@ kaitai::kstruct* rekordbox_pdb_t::row_ref_t::body() {
11381081 }
11391082 case rekordbox_pdb_t ::PAGE_TYPE_HISTORY_PLAYLISTS : {
11401083 n_body = false ;
1141- m_body = std::unique_ptr<history_playlist_row_t >(
1142- new history_playlist_row_t (m__io, this , m__root));
1084+ m_body = std::unique_ptr<history_playlist_row_t >(new history_playlist_row_t (m__io, this , m__root));
11431085 break ;
11441086 }
11451087 case rekordbox_pdb_t ::PAGE_TYPE_ARTWORK : {
@@ -1149,8 +1091,7 @@ kaitai::kstruct* rekordbox_pdb_t::row_ref_t::body() {
11491091 }
11501092 case rekordbox_pdb_t ::PAGE_TYPE_PLAYLIST_ENTRIES : {
11511093 n_body = false ;
1152- m_body = std::unique_ptr<playlist_entry_row_t >(
1153- new playlist_entry_row_t (m__io, this , m__root));
1094+ m_body = std::unique_ptr<playlist_entry_row_t >(new playlist_entry_row_t (m__io, this , m__root));
11541095 break ;
11551096 }
11561097 case rekordbox_pdb_t ::PAGE_TYPE_LABELS : {
@@ -1165,8 +1106,7 @@ kaitai::kstruct* rekordbox_pdb_t::row_ref_t::body() {
11651106 }
11661107 case rekordbox_pdb_t ::PAGE_TYPE_HISTORY_ENTRIES : {
11671108 n_body = false ;
1168- m_body = std::unique_ptr<history_entry_row_t >(
1169- new history_entry_row_t (m__io, this , m__root));
1109+ m_body = std::unique_ptr<history_entry_row_t >(new history_entry_row_t (m__io, this , m__root));
11701110 break ;
11711111 }
11721112 case rekordbox_pdb_t ::PAGE_TYPE_COLORS : {
0 commit comments