31 #ifdef _IC_BUILDER_ZLIB_ 38 #ifdef _IC_BUILDER_ZLIB_ 39 bool zipFile(
const char *filename,
const char *additional_extension)
43 char big_buffer[0x1000];
45 gzFile unzipped_file = gzopen(filename,
"rb");
46 gzFile zipped_file = gzopen(gzip_file_name.c_str(),
"wb");
48 if (unzipped_file != NULL && zipped_file != NULL)
50 bytes_read = gzread(unzipped_file, big_buffer, 0x1000);
51 while (bytes_read > 0)
53 if (gzwrite(zipped_file, big_buffer, bytes_read) != bytes_read)
55 std::cerr <<
"ZipFile(" << filename <<
"->" << gzip_file_name <<
") Error on writing." <<
std::endl;
60 bytes_read = gzread(unzipped_file, big_buffer, 0x1000);
64 if (unzipped_file != NULL)
66 gzclose(unzipped_file);
68 if (zipped_file != NULL)
77 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 79 bool ZipFile(
const char *filename,
const char *additional_extension)
81 return zipFile(filename, additional_extension);
ThreadStream & endl(ThreadStream &stream)
Contains global filesystem related functions, encapsulated into the icl_core::os namespace.
Contains Interface base classes and base types.