Russian Qt Forum
Июнь 01, 2024, 20:34 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1] 2   Вниз
  Печать  
Автор Тема: Нужен простой способ работы с каким-либо архиватором  (Прочитано 10350 раз)
DpoHro
Гость
« : Май 16, 2009, 21:31 »

На сервер в базу складываются html страницы с картинками, файлами стилей и пр. запакованные архиватором (каким?), клиент качает и распаковывает у себя.

Нужно сделать распаковку таким образом, чтобы пользователь никак ей не смог помешать - это про консольные окна (если запускать архиватор через QProcess), а может можно запускать не показывая окна? Тогда еще необходимо дожидаться завершения распаковки.

Вобщем нужен совет:
1) Как решить эту проблему наиболее простым способом
2) Как решить это правильно/красиво.

))
Записан
ритт
Гость
« Ответ #1 : Май 16, 2009, 22:09 »

quazip?
Записан
DpoHro
Гость
« Ответ #2 : Май 16, 2009, 22:13 »

чтото я его скомпилить не могу ((
где zlib лежит указал
Как вообще этот проект скомпилить в виндах?
Записан
ритт
Гость
« Ответ #3 : Май 16, 2009, 23:53 »

qmake && make
слышал, под студией бывает проблемно собрать, но это легко лечится...
Записан
DpoHro
Гость
« Ответ #4 : Май 17, 2009, 00:53 »

qmake && make
слышал, под студией бывает проблемно собрать, но это легко лечится...
Это из студийной командной строки надо понимать?
На qmake - ничего не пишет, make выдает:
Цитировать
MAKE Version 5.2  Copyright (c) 1987, 1998 Inprise Corp.
Fatal makefile 187: No terminator specified for in-line file operator

Если nmake то:
Цитировать
   cd quazip\ && "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile
   "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.Debug
   cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -W3 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -D_WINDOWS -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtGui" -I"c:\Qt\4.4.3\include\QtGui" -I"c:\Qt\4.4.3\include" -I"." -I"debug" -I"\src\3rdparty\zlib" -I"c:\Qt\4.4.3\include\ActiveQt" -I"debug" -I".\GeneratedFiles" -I"c:\Qt\4.4.3\mkspecs\default" -Fodebug\ @C:\DOCUME~1\9335~1\LOCALS~1\Temp\nm1CFE.tmp
ioapi.c
.\ioapi.c(74) : error C2275: 'FILE' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(69) : see declaration of 'FILE'
.\ioapi.c(74) : error C2065: 'file' : undeclared identifier
.\ioapi.c(75) : error C2143: syntax error : missing ';' before 'const'
.\ioapi.c(77) : error C2065: 'mode_fopen' : undeclared identifier
.\ioapi.c(77) : warning C4047: '=' : 'int' differs in levels of indirection from 'char [3]'
.\ioapi.c(80) : error C2065: 'mode_fopen' : undeclared identifier
.\ioapi.c(80) : warning C4047: '=' : 'int' differs in levels of indirection from 'char [4]'
.\ioapi.c(83) : error C2065: 'mode_fopen' : undeclared identifier
.\ioapi.c(83) : warning C4047: '=' : 'int' differs in levels of indirection from 'char [3]'
.\ioapi.c(85) : error C2065: 'mode_fopen' : undeclared identifier
.\ioapi.c(85) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *'
.\ioapi.c(86) : error C2065: 'file' : undeclared identifier
.\ioapi.c(86) : error C2065: 'mode_fopen' : undeclared identifier
.\ioapi.c(86) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
.\ioapi.c(86) : warning C4024: 'fopen' : different types for formal and actual parameter 2
.\ioapi.c(86) : warning C4047: '=' : 'int' differs in levels of indirection from 'FILE *'
.\ioapi.c(87) : error C2065: 'file' : undeclared identifier
.\ioapi.c(87) : warning C4047: 'return' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(91) : error C2061: syntax error : identifier 'fread_file_func'
.\ioapi.c(91) : error C2059: syntax error : ';'
.\ioapi.c(91) : error C2143: syntax error : missing ')' before ','
.\ioapi.c(91) : error C2059: syntax error : ')'
.\ioapi.c(92) : error C2146: syntax error : missing ';' before identifier 'voidpf'
.\ioapi.c(92) : error C2061: syntax error : identifier 'opaque'
.\ioapi.c(92) : error C2059: syntax error : ';'
.\ioapi.c(93) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(94) : error C2040: 'buf' : 'void *' differs in levels of indirection from 'int'
.\ioapi.c(95) : warning C4142: benign redefinition of type
.\ioapi.c(96) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(101) : error C2059: syntax error : '}'
.\ioapi.c(105) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(106) : error C2040: 'buf' : 'const void *' differs in levels of indirection from 'int'
.\ioapi.c(107) : warning C4142: benign redefinition of type
.\ioapi.c(108) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(113) : error C2059: syntax error : '}'
.\ioapi.c(116) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(117) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(122) : error C2059: syntax error : '}'
.\ioapi.c(125) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(128) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(148) : error C2059: syntax error : '}'
.\ioapi.c(151) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(152) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(157) : error C2059: syntax error : '}'
.\ioapi.c(160) : error C2040: 'stream' : 'voidpf' differs in levels of indirection from 'int'
.\ioapi.c(161) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(166) : error C2059: syntax error : '}'
.\ioapi.c(169) : error C2449: found '{' at file scope (missing function header?)
.\ioapi.c(178) : error C2059: syntax error : '}'
unzip.c
c:\quazip-0.2.3\quazip\crypt.h(38) : error C2143: syntax error : missing ';' before 'type'
c:\quazip-0.2.3\quazip\crypt.h(42) : error C2065: 'temp' : undeclared identifier
c:\quazip-0.2.3\quazip\crypt.h(43) : error C2065: 'temp' : undeclared identifier
c:\quazip-0.2.3\quazip\crypt.h(43) : error C2065: 'temp' : undeclared identifier
zip.c
c:\quazip-0.2.3\quazip\crypt.h(38) : error C2143: syntax error : missing ';' before 'type'
c:\quazip-0.2.3\quazip\crypt.h(42) : error C2065: 'temp' : undeclared identifier
c:\quazip-0.2.3\quazip\crypt.h(43) : error C2065: 'temp' : undeclared identifier
c:\quazip-0.2.3\quazip\crypt.h(43) : error C2065: 'temp' : undeclared identifier
.\zip.c(324) : error C2275: 'uLong' : illegal use of this type as an expression
        c:\quazip-0.2.3\quazip\zconf.h(264) : see declaration of 'uLong'
.\zip.c(324) : error C2146: syntax error : missing ';' before identifier 'year'
.\zip.c(324) : error C2065: 'year' : undeclared identifier
.\zip.c(325) : error C2065: 'year' : undeclared identifier
.\zip.c(326) : error C2065: 'year' : undeclared identifier
.\zip.c(327) : error C2065: 'year' : undeclared identifier
.\zip.c(328) : error C2065: 'year' : undeclared identifier
.\zip.c(330) : error C2065: 'year' : undeclared identifier
Generating Code...

Не собирал я ранее такие проекты, уж звиняйте, если кто знает как собирать эту вещицу, напишите пошагам если не трудно.
Записан
spectre71
Гость
« Ответ #5 : Май 20, 2009, 09:49 »

чтото я его скомпилить не могу ((
где zlib лежит указал
Как вообще этот проект скомпилить в виндах?

А почему не воспользоваться
QByteArray qCompress ( const QByteArray & data, int compressionLevel = -1 )
QByteArray qCompress ( const uchar * data, int nbytes, int compressionLevel = -1 )
QByteArray qUncompress ( const QByteArray & data )
QByteArray qUncompress ( const uchar * data, int nbytes )
Записан
DpoHro
Гость
« Ответ #6 : Май 20, 2009, 13:02 »

У меня может быть на каждый документ по несколько файлов, могут быть и папки в которых также могут быть файлы.
Сдается мне это долго делать придется.
Записан
ритт
Гость
« Ответ #7 : Май 20, 2009, 17:49 »

советую забыть про quazip. и извиняюсь, что посоветовал посмотреть в его сторону.
сам я на него не смотрел, а только использовал для примитивных целей (распаковка архива в папку), что немногим менее примитивно, чем его (квазипа) примеры...
на днях потребовалась навигация по структуре, возможность распаковывать отдельные файлы, допаковывать новые и т.п. - углубился в квазип и был шокирован дерьмовостью реализации. качественный пример гомнокода!
сейчас использую немного модифицированный qzip из Qt4.5 и пока что доволен - почти всем моим требованиям пока удовлетворяет и написан качественно.
Записан
DpoHro
Гость
« Ответ #8 : Май 21, 2009, 10:51 »

qzip с версии 4.5? Или это из сорсов взято?
Записан
ритт
Гость
« Ответ #9 : Май 21, 2009, 19:18 »

в 4.5 появилась поддержка одф.
src/gui/text/qzip* - эти три файлика нужно скопировать в свой проект и слегка почистить (убрать некоторые кутэшные макросы). затем можно использовать. по принципу похоже на квазип (т.к. зип вообще даёт довольно узкий функционал), но работать с этими классами гораздо удобнее!
Записан
DpoHro
Гость
« Ответ #10 : Май 21, 2009, 20:21 »

Я правильно понял, что с его помощью можно распаковывать zip-архивы, в которых могут содержаться вложенные папки и файлы в них произвольного уровня вложенности?
Записан
ритт
Гость
« Ответ #11 : Май 21, 2009, 21:04 »

да
Записан
DpoHro
Гость
« Ответ #12 : Май 21, 2009, 21:08 »

Буду разбираться тогда с ним,

Спасибо!
Записан
kirill
Гость
« Ответ #13 : Май 22, 2009, 05:32 »

http://osdab.googlecode.com/files/OSDaB-Zip-20080907.tar.bz2

Description
Meet a couple of pure-Qt/C++ classes capable of handling PKZIP 2.0 compatible zip archives.

This is not a "port" of some other existing implementation, everything has been written from scratch (althought some code was actually inspired by existing public domain projects) and it's all pure C++/Qt. Please note that this is not a complete stand-alone library, it's just a bunch of classes. You will have to add them to your project and modify them to best fit your needs.

Записан
ритт
Гость
« Ответ #14 : Май 22, 2009, 05:46 »

кстати, да, совсем забыл про OSDaB Улыбающийся
не такой удобный, как qzip, и по большей части заточен под венду, но в частных случаях имеет свои преимущества...скрестить бы их :мечтательно:
« Последнее редактирование: Май 22, 2009, 05:49 от Константин » Записан
Страниц: [1] 2   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.072 секунд. Запросов: 20.