| 47 | |
| 48 | |
| 49 | static bool copyData(QIODevice &inFile, QIODevice &outFile) |
| 50 | { |
| 51 | char* buf = new char[4096]; |
| 52 | while (!inFile.atEnd()) { |
| 53 | memset(buf, 0, 4096); |
| 54 | qint64 readLen = inFile.read(buf, 4096); |
| 55 | if (readLen <= 0) { |
| 56 | delete [] buf; |
| 57 | return false; |
| 58 | } |
| 59 | if (outFile.write(buf, readLen) != readLen) { |
| 60 | delete [] buf; |
| 61 | return false; |
| 62 | } |
| 63 | } |
| 64 | delete [] buf; |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | /**OK |
| 69 | * Comprime il file fileName, nell'oggetto zip, con il nome fileDest. |
no test coverage detected