Quazip functions
-
hi to every one
i had a problem with -qunzip- quazip compilation that it was solved, thanks to every one
but now i want to use this lib
i have a QString containing the data of a file that is compressed and variable's name is comp
i use this code
@ JlCompress l;
comp = l.extractFile(comp,"mm");@
i think now comp variable should have a extracted file ,is it correct?
should i use another way?[edit : changed qunzip in title to quazip, Eddy]
-
Is this a different question than what you are aready discussing in "this":http://developer.qt.nokia.com/forums/viewthread/10120/ topic?
-
this is a italian documentation
http://quazip.sourceforge.net/classJlCompress.html -
OK, this method:
@static QString extractFile(QString fileCompressed, QString file, QString fileDest = QString());@get first param - path to your .zip file
get second param - name of file for extracting in .zip archive.
get third param - name for uncompressed version of file.if third param is not set, fileDest = file, i.e. destination file will has same name ("mm" in your example)
After this method finished, destination file will created. and method return you path to this file (not data, data already in file on hdd).More, it is static method, you are not needed create instance of JlCompress
just make:
@QString comp = JlCompress::extractFile(comp,"mm"); // comp is a filePath
....
@ -
I think you can.
But for this you need use lower level of quazip, you need use QuaZip class
It has constructor
@QuaZip(QIODevice *ioDevice);@
and you can set QDataStream.Also QuaZip class was written by russian guy and it has english documentation, also you can look to tests - its are good examples of using.
-
A [[Doc:QDataStream]] is not a [[Doc:QIODevice]], one would have to pass a [[Doc:QFile]] or another QIODevice subclass to the QuaZip constructor.
How do you "have the compressed file in the cell" of your table? We speak of arbitrary binary data, which needs to be stored in a QByteArray and which is hardly ever readable to a human.
-
it is a blob cell that contain a zipped file, how can i use this with quazip?
i tried to open this blob cell to a qstring or qbytearray but it does'nt work correctly , it load only a few charachters , i think it has null values into it , what should i do? -
Sorry, I misread your post. A "cell in the table" usually triggers the concept of something like a [[Doc:QTableWidget]] in Qt world (and not only there). You were referring to a BLOB column of a database table, which make much more sense.
In that case:
Read the BLOB data into a [[Doc:QByteArray]], feed that as that data storage to a [[Doc:QBuffer]] and feed that to the QuaZip constructor mentioned by Vass.