Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, May 2007
Does Qt have a ZipEngine?


Message 1 in thread

I read in Qt doc:
 QAbstractSocketEngine *ZipEngineHandler::create(const QString 
&fileName) const
 {
     // ZipEngineHandler returns a ZipEngine for all .zip files
     return fileName.toLower().endsWith(".zip") ? new 
ZipEngine(fileName) : 0;
 }
I wonder if there is a build-in ZipEngin.

Thanks in advance,
Lingfa


--
 [ signature omitted ] 

Message 2 in thread

On 5/30/07, Lingfa Yang <lingfa@xxxxxxx> wrote:
> I read in Qt doc:
>  QAbstractSocketEngine *ZipEngineHandler::create(const QString
> &fileName) const
>  {
>      // ZipEngineHandler returns a ZipEngine for all .zip files
>      return fileName.toLower().endsWith(".zip") ? new
> ZipEngine(fileName) : 0;
>  }
> I wonder if there is a build-in ZipEngin.

That's just an example of a FileEngine that you could implement. It
doesn't actually exist.

-- 
 [ signature omitted ] 

Message 3 in thread

Andrew Medico wrote:

> On 5/30/07, Lingfa Yang <lingfa@xxxxxxx> wrote:
>
>> I read in Qt doc:
>>  QAbstractSocketEngine *ZipEngineHandler::create(const QString
>> &fileName) const
>>  {
>>      // ZipEngineHandler returns a ZipEngine for all .zip files
>>      return fileName.toLower().endsWith(".zip") ? new
>> ZipEngine(fileName) : 0;
>>  }
>> I wonder if there is a build-in ZipEngin.
>
>
> That's just an example of a FileEngine that you could implement. It
> doesn't actually exist.
>
Thanks Andrew.

Python iterate files in a zip like this:

from zipfile import ZipFile
inFileName = r"C:\Documents and Settings\test.ppt.pptx"
origPptFile = ZipFile(inFileName, "r")
for name in origPptFile.namelist():
  . . .

I guess there is no way simple way to do the job in Qt,  because there 
is no zip library available, right?
Does anyone know a zip library?

Thanks,
Lingfa



--
 [ signature omitted ] 

Message 4 in thread

On 30.05.07 14:37:44, Lingfa Yang wrote:
> Andrew Medico wrote:
> >On 5/30/07, Lingfa Yang <lingfa@xxxxxxx> wrote:
> >
> >>I read in Qt doc:
> >> QAbstractSocketEngine *ZipEngineHandler::create(const QString
> >>&fileName) const
> >> {
> >>     // ZipEngineHandler returns a ZipEngine for all .zip files
> >>     return fileName.toLower().endsWith(".zip") ? new
> >>ZipEngine(fileName) : 0;
> >> }
> >>I wonder if there is a build-in ZipEngin.
> >
> >
> >That's just an example of a FileEngine that you could implement. It
> >doesn't actually exist.
> >
> Thanks Andrew.
> 
> Python iterate files in a zip like this:
> 
> >from zipfile import ZipFile
> inFileName = r"C:\Documents and Settings\test.ppt.pptx"
> origPptFile = ZipFile(inFileName, "r")
> for name in origPptFile.namelist():
>  . . .
> 
> I guess there is no way simple way to do the job in Qt,  because there is no 
> zip library available, right?
> Does anyone know a zip library?

zlib for example, and Qt has qCompress qUnCompress functions for
working with simple zips.

Andreas

-- 
 [ signature omitted ] 

Message 5 in thread

On Wednesday 30 May 2007 20:37:44 Lingfa Yang wrote:

> I guess there is no way simple way to do the job in Qt,  because there
> is no zip library available, right?
> Does anyone know a zip library?

Most likely the same one as the python library is using.

http://www.zlib.net/

Everyone uses that. Case in point:

esben@spurv:~/download$ ldd /usr/lib/libQtCore.so.4.2.3 | grep libz
        libz.so.1 => /usr/lib/libz.so.1 (0x00002b6e465ad000)

-- 
 [ signature omitted ]