| 93 | } |
| 94 | |
| 95 | bool ZipMaker::AddFromBuffer(const char *innerFile, const char *buffer, unsigned int buferSize) |
| 96 | { |
| 97 | assert(buffer); |
| 98 | assert(innerFile); |
| 99 | assert(m_zDoc); |
| 100 | int level = m_opt_compress_level; |
| 101 | |
| 102 | if (level < Z_DEFAULT_COMPRESSION || level > Z_BEST_COMPRESSION){ |
| 103 | level = Z_DEFAULT_COMPRESSION; |
| 104 | } |
| 105 | |
| 106 | zipOpenNewFileInZip((zipFile)m_zDoc,innerFile,(zip_fileinfo*)m_zi, |
| 107 | NULL,0,NULL,0,NULL , |
| 108 | Z_DEFLATED, |
| 109 | level); |
| 110 | |
| 111 | zipWriteInFileInZip((zipFile)m_zDoc, buffer, (unsigned int)buferSize); |
| 112 | |
| 113 | zipCloseFileInZip((zipFile)m_zDoc); |
| 114 | |
| 115 | return true; |
| 116 | } |
| 117 | |
| 118 | bool ZipMaker::AddFromFile(const char *localFile, const char *innerFile) |
| 119 | { |
no test coverage detected