bool Container::file_exists(const path& relative_path) { std::string folder = relative_path.get_folderpath_unsecure(); auto fnode = handle_.get_filenode(relative_path); return fnode.p == folder; }
void Container::extract_file(const path& relative_path) { send_callback(INFORMATION, EXTRACT_FILE, relative_path.raw_std_str()); if (file_exists(relative_path.str())) { std::string location(relative_path.str()); std::string filename(relative_path.get_filename()); std::string folder(relative_path.get_folderpath_unsecure()); container_handle::file_node fnode = handle_.get_filenode(relative_path); if (fnode.p == folder) { switch (algo_) { case AES: helper_extract_file<CryptoPP::AES>(fnode, (*volume_).drive_letter); break; case SERPENT: helper_extract_file<CryptoPP::Serpent>(fnode, (*volume_).drive_letter); break; case TWOFISH: helper_extract_file<CryptoPP::Twofish>(fnode, (*volume_).drive_letter); break; } } } //THROW }