58 map<string,ZipInfo>::const_iterator
i =
m_index.find(fname);
59 if ( i ==
m_index.end() )
return false;
60 cout <<
" found " << fname <<endl;
61 cout <<
" compress = " << i->second.compress << endl;
62 cout <<
" crc = " << i->second.crc << endl;
63 cout <<
" data_size = " << i->second.data_size << endl;
64 cout <<
" file_size = " << i->second.file_size << endl;
65 cout <<
" file_offset = " << i->second.file_offset << endl;
67 m_file.seekg( i->second.file_offset,ios::beg);
68 uint32_t magic = get<uint32_t>(
m_file);
69 if (magic!=0x04034B50) {
70 cout <<
"bad magic " << hex << magic << endl;
74 uint16_t fnamsize = get<uint16_t>(
m_file) ;
75 cout <<
" got fnamsize " << fnamsize << endl;
76 uint16_t extrasize= get<uint16_t>(
m_file);
77 cout <<
" got extrasize " << extrasize << endl;
78 m_file.seekg( 0, ios::beg );
79 uint32_t offset = i->second.file_offset+30+fnamsize+extrasize;
80 if (i->second.compress == 0 ) {
81 cout <<
"creating slice at " << offset <<
" + " << i->second.data_size << endl;
82 io::copy( io::slice(
m_file,offset,i->second.data_size), os );
84 }
else if (i->second.compress == 8) {
85 io::zlib_params params; params.noheader =
true;
86 io::filtering_istream in;
87 in.push(io::zlib_decompressor(params));
88 cout <<
"creating slice at " << offset <<
" + " << i->second.data_size << endl;
89 in.push(io::slice(
m_file, offset,i->second.data_size));
map< string, ZipInfo > m_index