| 25 | static ErrorCode addFile(zipFile file, String * path); |
| 26 | |
| 27 | ErrorCode mailcore::CreateZipFileFromFolder(String * zipFilename, String * path) |
| 28 | { |
| 29 | #ifdef _MSC_VER |
| 30 | zlib_filefunc64_def ffunc; |
| 31 | fill_win32_filefunc64A(&ffunc); |
| 32 | zipFile file = zipOpen2_64(zipFilename->fileSystemRepresentation(), APPEND_STATUS_CREATE, NULL, &ffunc); |
| 33 | #else |
| 34 | zipFile file = zipOpen(zipFilename->fileSystemRepresentation(), APPEND_STATUS_CREATE); |
| 35 | #endif |
| 36 | if (file == NULL) { |
| 37 | return ErrorFile; |
| 38 | } |
| 39 | |
| 40 | addFile(file, path); |
| 41 | |
| 42 | int err = zipClose(file, NULL); |
| 43 | if (err != ZIP_OK) { |
| 44 | return ErrorFile; |
| 45 | } |
| 46 | |
| 47 | return ErrorNone; |
| 48 | } |
| 49 | |
| 50 | static ErrorCode addFile(zipFile file, String * path) |
| 51 | { |
nothing calls this directly
no test coverage detected