From 6f6f8f67978544932118b46a4e633d0762afb539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Tabin?= Date: Sat, 18 Apr 2020 13:04:31 +0200 Subject: [PATCH] Renamal of DEFAULT_CHUNK_SIZE define --- src/libzippp.cpp | 2 +- src/libzippp.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libzippp.cpp b/src/libzippp.cpp index 459299f..74f590a 100644 --- a/src/libzippp.cpp +++ b/src/libzippp.cpp @@ -585,7 +585,7 @@ int ZipArchive::readEntry(const ZipEntry& zipEntry, std::ostream& ofOutput, Stat struct zip_file* zipFile = zip_fopen_index(zipHandle, zipEntry.getIndex(), flag); if (zipFile) { libzippp_uint64 maxSize = zipEntry.getSize(); - if (!chunksize) { chunksize = DEFAULT_CHUNK_SIZE; } // use the default chunk size (512K) if not specified by the user + if (!chunksize) { chunksize = LIBZIPPP_DEFAULT_CHUNK_SIZE; } // use the default chunk size (512K) if not specified by the user if (maxSize0 && (str)[(str).length()-1]==LIBZIPPP_ENTRY_PATH_SEPARATOR) -#define DEFAULT_CHUNK_SIZE 524288 +#define LIBZIPPP_DEFAULT_CHUNK_SIZE 524288 //libzip documentation //- http://www.nih.at/libzip/libzip.html @@ -300,10 +300,10 @@ namespace libzippp { * a memory allocation has failed, LIBZIPPP_ERROR_FREAD_FAILURE if zip_fread() didn't succeed to read data, * LIBZIPPP_ERROR_OWRITE_INDEX_FAILURE if the last ofstream operation has failed, LIBZIPPP_ERROR_OWRITE_FAILURE if fread() didn't * return the exact amount of requested bytes and -9 if the amount of extracted bytes didn't match the size of the file (unknown error). - * If the provided chunk size is zero, it will be defaulted to DEFAULT_CHUNK_SIZE (512KB). + * If the provided chunk size is zero, it will be defaulted to LIBZIPPP_DEFAULT_CHUNK_SIZE (512KB). * The method doesn't close the ofstream after the extraction. */ - int readEntry(const ZipEntry& zipEntry, std::ostream& ofOutput, State state=CURRENT, libzippp_uint64 chunksize=DEFAULT_CHUNK_SIZE) const; + int readEntry(const ZipEntry& zipEntry, std::ostream& ofOutput, State state=CURRENT, libzippp_uint64 chunksize=LIBZIPPP_DEFAULT_CHUNK_SIZE) const; /** * Deletes the specified entry from the zip file. If the entry is a folder, all its @@ -514,10 +514,10 @@ namespace libzippp { * a memory allocation has failed, LIBZIPPP_ERROR_FREAD_FAILURE if zip_fread() didn't succeed to read data, * LIBZIPPP_ERROR_OWRITE_INDEX_FAILURE if the last ofstream operation has failed, LIBZIPPP_ERROR_OWRITE_FAILURE if fread() didn't * return the exact amount of requested bytes and -9 if the amount of extracted bytes didn't match the size of the file (unknown error). - * If the provided chunk size is zero, it will be defaulted to DEFAULT_CHUNK_SIZE (512KB). + * If the provided chunk size is zero, it will be defaulted to LIBZIPPP_DEFAULT_CHUNK_SIZE (512KB). * The method doesn't close the ofstream after the extraction. */ - int readContent(std::ostream& ofOutput, ZipArchive::State state=ZipArchive::CURRENT, libzippp_uint64 chunksize=DEFAULT_CHUNK_SIZE) const; + int readContent(std::ostream& ofOutput, ZipArchive::State state=ZipArchive::CURRENT, libzippp_uint64 chunksize=LIBZIPPP_DEFAULT_CHUNK_SIZE) const; private: const ZipArchive* zipFile;