资源简介
一个关于ofd editor的代码,可以下载学习,自己觉得很有用
代码片段和文件信息
/*
Copyright (C) 2010 Roberto Pompermaier
Copyright (C) 2005-2014 Sergey A. Tachenov
This file is part of QuaZIP.
QuaZIP is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation either version 2.1 of the License or
(at your option) any later version.
QuaZIP is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with QuaZIP. If not see .
See COPYING file for the full LGPL text.
Original ZIP package is copyrighted by Gilles Vollant and contributors
see quazip/(un)zip.h files for details. Basically it‘s the zlib license.
*/
#include “JlCompress.h“
#include
static bool copyData(QIODevice &inFile QIODevice &outFile)
{
while (!inFile.atEnd()) {
char buf[4096];
qint64 readLen = inFile.read(buf 4096);
if (readLen <= 0)
return false;
if (outFile.write(buf readLen) != readLen)
return false;
}
return true;
}
bool JlCompress::compressFile(QuaZip* zip QString fileName QString fileDest) {
// zip: oggetto dove aggiungere il file
// fileName: nome del file reale
// fileDest: nome del file all‘interno del file compresso
// Controllo l‘apertura dello zip
if (!zip) return false;
if (zip->getMode()!=QuaZip::mdCreate &&
zip->getMode()!=QuaZip::mdAppend &&
zip->getMode()!=QuaZip::mdAdd) return false;
// Apro il file originale
QFile inFile;
inFile.setFileName(fileName);
if(!inFile.open(QIODevice::ReadOnly)) return false;
// Apro il file risulato
QuaZipFile outFile(zip);
if(!outFile.open(QIODevice::WriteOnly QuaZipNewInfo(fileDest inFile.fileName()))) return false;
// Copio i dati
if (!copyData(inFile outFile) || outFile.getZipError()!=UNZ_OK) {
return false;
}
// Chiudo i file
outFile.close();
if (outFile.getZipError()!=UNZ_OK) return false;
inFile.close();
return true;
}
bool JlCompress::compressSubDir(QuaZip* zip QString dir QString origDir bool recursive QDir::Filters filters) {
// zip: oggetto dove aggiungere il file
// dir: cartella reale corrente
// origDir: cartella reale originale
// (path(dir)-path(origDir)) = path interno all‘oggetto zip
// Controllo l‘apertura dello zip
if (!zip) return false;
if (zip->getMode()!=QuaZip::mdCreate &&
zip->getMode()!=QuaZip::mdAppend &&
zip->getMode()!=QuaZip::mdAdd) return false;
// Controllo la cartella
QDir directory(dir);
if (!directory.exists()) return false;
QDir origDirectory(origDir);
if (dir != origDir) {
QuaZipFile dirZipFile(zip);
if (!dirZipFile.open(QIODe
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-06-23 07:10 ofdEditor\
文件 331 2017-06-23 07:10 ofdEditor\.gitignore
文件 1072 2017-06-23 07:10 ofdEditor\LICENSE
文件 2556 2017-06-23 07:10 ofdEditor\README.md
目录 0 2017-06-23 07:10 ofdEditor\ofdEditor\
目录 0 2017-06-23 07:10 ofdEditor\ofdEditor\libs\
文件 720650 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip.zip
目录 0 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\
目录 0 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\
文件 12260 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\JlCompress.cpp
文件 8127 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\JlCompress.h
文件 4808 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\crypt.h
文件 7136 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\ioapi.h
文件 11163 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\qioapi.cpp
文件 1383 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quaadler32.cpp
文件 1459 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quaadler32.h
文件 2286 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quachecksum32.h
文件 1329 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quacrc32.cpp
文件 1380 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quacrc32.h
文件 4310 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quagzipfile.cpp
文件 3683 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quagzipfile.h
文件 9241 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quaziodevice.cpp
文件 3420 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quaziodevice.h
文件 21778 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazip.cpp
文件 25307 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazip.h
文件 1738 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazip_global.h
文件 16314 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazipdir.cpp
文件 8300 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazipdir.h
文件 14694 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazipfile.cpp
文件 20019 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazipfile.h
文件 6620 2017-06-23 07:10 ofdEditor\ofdEditor\libs\quazip\includes\quazipfileinfo.cpp
............此处省略262个文件信息
- 上一篇:1stOpt中文教程
- 下一篇:火电机组锅炉效率和汽缸效率计算软件
相关资源
- 虚拟磁盘系统完整项目
- IEC61850客户端代码
- 基于QtOpenCV实现GraphCuts算法
- 基于颜色识别的火焰检测算法的open
- GNSS-SDR_manual.pdf (v0.0.9)
- qt qss主题样式
- Qt虚拟仪表源码
- 基于Qt的学生公寓管理系统源码
- qt编写的word写字板
- qt5音乐播放器更新版 源码
- Qt 资源库 图片
-
QT 实现的mpla
yer后台KTV点歌系统 - Qt GUI 界面通用系统模板 源码
- zw_landeng1986-10598316-qTC275KIT.zip
- 英雄联盟10.26最新走A
- 基于QT的捕鱼达人小游戏
- Qt中文帮助手册简易版
- 两个吃一个棋类游戏
- opencv3.4.3 mingw32编译
- 路灯控制系统开源
- qt-vsaddin-msvc2017-2.2.2.vsix
- STM32+MQTT+SIM800使用AT指令实现
- NOIP2019提高组突破营课件.rar
- PyQt5类继承图
- zigbee的无线通信
- 云盘项目开发全部内容包括源码解析
- QT利用SMTP发送邮件Demo
- 计算机算法设计与分析 第4版 (王晓
- Qt样式表葵花宝典.zip
- Qt迷宫及路径
评论
共有 条评论