@@ -45,4 +45,41 @@ TEST(OldMs, test) {
4545 const std::string table =
4646 internal::util::stream::read (*files.open (tableStreamPath).stream ());
4747 std::cout << tableStreamPath << " size " << table.size () << std::endl;
48+
49+ const auto table_stream = files.open (tableStreamPath).stream ();
50+ std::cout << " Fib.fibRgFcLcb->clx.fc " << fib.fibRgFcLcb ->clx .fc << std::endl;
51+ std::cout << " Fib.fibRgFcLcb->clx.lcb " << fib.fibRgFcLcb ->clx .lcb
52+ << std::endl;
53+ table_stream->ignore (fib.fibRgFcLcb ->clx .fc );
54+ internal::oldms::read_Clx (
55+ *table_stream, internal::oldms::skip_Prc, [&](std::istream &in) {
56+ if (const int c = in.get (); c != 0x2 ) {
57+ throw std::runtime_error (" Unexpected input: " + std::to_string (c));
58+ }
59+ const std::uint32_t lcb =
60+ internal::util::byte_stream::read<std::uint32_t >(in);
61+ std::cout << " lcb " << lcb << std::endl;
62+ std::string plcPcd = internal::util::stream::read (in, lcb);
63+ const internal::oldms::PlcPcdMap plc_pcd_map (plcPcd.data (),
64+ plcPcd.size ());
65+ std::cout << " plc_pcd_map n " << plc_pcd_map.n () << std::endl;
66+ std::cout << " plc_pcd_map aCP(0) " << plc_pcd_map.aCP (0 ) << std::endl;
67+ std::cout << " plc_pcd_map aCP(1) " << plc_pcd_map.aCP (1 ) << std::endl;
68+ std::cout << " plc_pcd_map aData(0).fc.fc " << plc_pcd_map.aData (0 ).fc .fc
69+ << std::endl;
70+ std::cout << " plc_pcd_map aData(0).fc.fCompressed "
71+ << plc_pcd_map.aData (0 ).fc .fCompressed << std::endl;
72+
73+ const std::size_t first_text_offset = plc_pcd_map.aData (0 ).fc .fc / 2 ;
74+ const std::size_t first_text_length =
75+ plc_pcd_map.aCP (1 ) - plc_pcd_map.aCP (0 );
76+ std::cout << " first_text_length " << first_text_length << std::endl;
77+ std::cout << " first_text_offset " << first_text_offset << std::endl;
78+
79+ const auto document_stream = files.open (" /WordDocument" ).stream ();
80+ document_stream->ignore (first_text_offset);
81+ const std::string first_text =
82+ internal::util::stream::read (*document_stream, first_text_length);
83+ std::cout << " first_text " << first_text << std::endl;
84+ });
4885}
0 commit comments