Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SUWFrame::OnOpenArhive(wxCommandEvent &event) {
- if (ArhiveOpenDialog->ShowModal() == wxID_OK) {
- std::ifstream *arhive_file;
- arhive_file = new std::ifstream((char*)ArhiveOpenDialog->GetPath().mb_str(), std::ios::in | std::ios::binary);
- if (arhive_file->is_open()) {
- s_arhive_info *arhive_info = (s_arhive_info*)malloc(sizeof(s_arhive_info));
- arhive_file->read((char*)arhive_info, sizeof(s_arhive_info));
- wxString str;
- if (arhive_info->is_pswd)
- str << "Пароль " << arhive_info->pswd << ", ";
- else
- str << "Без пароля, ";
- str << arhive_info->files_count << " файлов, " << arhive_info->version_code << " версия.";
- str << "Size = " << sizeof(s_arhive_info);
- str << "Seek = " << arhive_file->tellg();
- wxMessageBox(str);
- for (int i = 0; i < arhive_info->files_count; i++) {
- t_onefile *onefile = (t_onefile*)malloc(sizeof(t_onefile));
- arhive_file->read((char*)onefile, sizeof(t_onefile));
- str.clear();
- str << onefile->fullpath;
- str << "Size = " << sizeof(t_onefile);
- str << "Seek = " << arhive_file->tellg();
- wxMessageBox(str);
- arhive_file->seekg(arhive_file->tellg()+onefile->size+1);
- }
- arhive_file->close();
- }
- }
- }
Add Comment
Please, Sign In to add comment