gzip 파일을 읽기 위해 부스트 필터링 스트림 개체를 사용하고 있습니다. 위대한 작품! 처리 된 파일의 양에 대한 진행률 표시 줄을 표시하고 싶습니다. 입력 된 압축되지 않은 파일 크기를 찾아야합니다. gzip 압축 풀기 프로그램은 gzip 파일의 원래 파일 크기에 액세스 할 수 있습니까? boost gzip_decompressor reference 페이지에서 찾을 수 없습니다. 실제로 진행 대화 상자가 목표입니다. 압축 파일의 위치를 파악할 수있는 또 다른 방법이 있습니까?boost filtering_istream gzip_decompressor 압축되지 않은 파일 크기
// gets compressed file size, need uncompressed size
boost::uintmax_t fs = boost::filesystem::file_size (
boost::filesystem::path (fname)
);
std::ifstream file (fname, std::ios_base::in | std::ios_base::binary);
boost::iostreams::filtering_istream in;
in.push (boost::iostreams::gzip_decompressor());
in.push (file);
std::string line;
size_t bytes_read = 0;
while (in)
{
std::getline (in, line);
bytes_read += line.size();
// progress dlg with bytes_read/uncompressed size
}
파일의 끝까지 탐색하기 쉽고 크기를 읽으십시오. 나는 그것을 할 것 같아. 감사. – Dan
또는 부스트를 수정하여이 정보를 추가하고 패치를 제출할 수 있습니다. 그렇다면 모든 사람들이 작업에서 이익을 얻습니다. – KeithB