| dtkio
                             dtk library for dtkio. | 
DArchiveManager类提供文档压缩解压功能 更多...
#include <darchivemanager.h>


| 类 | |
| struct | MgrArchiveData | 
| 压缩包数据  更多... | |
| struct | MgrCompressOptions | 
| 压缩选项  更多... | |
| struct | MgrExtractionOptions | 
| 解压选项  更多... | |
| struct | MgrFileEntry | 
| 文件数据  更多... | |
| struct | MgrUpdateOptions | 
| 更新选项  更多... | |
| Public 类型 | |
| enum | ArchivePluginType { APT_Auto , APT_Cli7z , APT_Libarchive , APT_Libzip , APT_Libpigz } | 
| 插件类型  更多... | |
| enum | ArchiveJobType { JT_NoJob = 0 , JT_Create , JT_Add , JT_Load , JT_Extract , JT_Delete , JT_Rename , JT_BatchExtract , JT_Open , JT_Update , JT_Comment , JT_Convert , JT_StepExtract } | 
| 操作类型  更多... | |
| enum | MgrPluginFinishType { PFT_Nomral = 0 , PFT_Cancel , PFT_Error } | 
| 插件结束类型  更多... | |
| enum | MgrErrorType { ET_NoError = 0 , ET_PluginError , ET_WrongPassword , ET_NeedPassword , ET_LongNameError , ET_ArchiveDamaged , ET_FileOpenError , ET_FileReadError , ET_FileWriteError , ET_DeleteError , ET_RenameError , ET_MissingVolume , ET_InsufficientDiskSpace , ET_UserCancelOpertion , ET_ExistVolume } | 
| 错误类型 更多... | |
| 信号 | |
| void | signalError (MgrErrorType eErrorType) | 
| 信号-错误信号 | |
| void | signalJobFinished (ArchiveJobType eJobType, MgrPluginFinishType eFinishType, MgrErrorType eErrorType) | 
| 信号-操作结束信号 | |
| void | signalprogress (double dPercentage) | 
| 信号-进度信号 | |
| void | signalCurFileName (const QString &strName) | 
| 信号-发送当前正在操作的文件名 | |
| void | signalFileWriteErrorName (const QString &strName) | 
| 信号-发送创建失败的文件名 | |
| void | signalCurArchiveName (const QString &strArchiveName) | 
| 信号-当前正在操作的压缩包信号 | |
| Public 成员函数 | |
| void | destory_instance () | 
| 获取单例实例对象 | |
| bool | createArchive (const QList< MgrFileEntry > &files, const QString &strDestination, const MgrCompressOptions &stOptions, ArchivePluginType eType) | 
| 创建压缩包 | |
| bool | loadArchive (const QString &strArchiveFullPath, ArchivePluginType eType=ArchivePluginType::APT_Auto) | 
| 加载压缩包数据 | |
| MgrArchiveData * | archiveData () | 
| 获取压缩包数据 | |
| bool | addFiles (const QString &strArchiveFullPath, const QList< MgrFileEntry > &listAddEntry, const MgrCompressOptions &stOptions) | 
| 向压缩包中添加文件 | |
| bool | extractFiles (const QString &strArchiveFullPath, const QList< MgrFileEntry > &files, const MgrExtractionOptions &stOptions, ArchivePluginType eType=ArchivePluginType::APT_Auto) | 
| 解压文件 | |
| bool | extractFiles2Path (const QString &strArchiveFullPath, const QList< MgrFileEntry > &listSelEntry, const MgrExtractionOptions &stOptions) | 
| 提取文件至指定目录 | |
| bool | deleteFiles (const QString &strArchiveFullPath, const QList< MgrFileEntry > &listSelEntry) | 
| 删除压缩包中的文件 | |
| bool | renameFiles (const QString &strArchiveFullPath, const QList< MgrFileEntry > &listSelEntry) | 
| 重命名压缩包中的文件 | |
| bool | batchExtractFiles (const QStringList &listFiles, const QString &strTargetPath) | 
| 批量解压 | |
| bool | openFile (const QString &strArchiveFullPath, const MgrFileEntry &stEntry, const QString &strTempExtractPath, const QString &strProgram) | 
| 打开压缩包中文件 | |
| bool | updateArchiveCacheData (const MgrUpdateOptions &stOptions) | 
| 更新本地压缩包缓存数据 | |
| bool | updateArchiveComment (const QString &strArchiveFullPath, const QString &strComment) | 
| 更新压缩包注释信息 | |
| bool | convertArchive (const QString &strOriginalArchiveFullPath, const QString &strTargetFullPath, const QString &strNewArchiveFullPath) | 
| 压缩包格式转换 | |
| bool | pauseOperation () | 
| 暂停操作 | |
| bool | continueOperation () | 
| 继续操作 | |
| bool | cancelOperation () | 
| 取消操作 | |
| QString | getCurFilePassword () | 
| 获取当前文件密码 | |
| bool | currentStatus () | 
| 当前任务状态 | |
| 静态 Public 成员函数 | |
| static DArchiveManager * | get_instance (void) | 
| 获取单例实例对象 | |
| Protected 属性 | |
| QScopedPointer< DArchiveManagerPrivate > | d_ptr | 
DArchiveManager类提供文档压缩解压功能
错误类型 
 
| bool DArchiveManager::addFiles | ( | const QString & | strArchiveFullPath, | 
| const QList< MgrFileEntry > & | listAddEntry, | ||
| const MgrCompressOptions & | stOptions | ||
| ) | 
向压缩包中添加文件
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | listAddEntry | 添加的文件(夹) | 
| [in] | stOptions | 压缩参数 | 
| MgrArchiveData * DArchiveManager::archiveData | ( | ) | 
获取压缩包数据
| bool DArchiveManager::batchExtractFiles | ( | const QStringList & | listFiles, | 
| const QString & | strTargetPath | ||
| ) | 
批量解压
| [in] | listFiles | 解压文件 | 
| [in] | strTargetPath | 解压路径 | 
| bool DArchiveManager::cancelOperation | ( | ) | 
取消操作
| bool DArchiveManager::continueOperation | ( | ) | 
继续操作
| bool DArchiveManager::convertArchive | ( | const QString & | strOriginalArchiveFullPath, | 
| const QString & | strTargetFullPath, | ||
| const QString & | strNewArchiveFullPath | ||
| ) | 
压缩包格式转换
| [in] | strOriginalArchiveFullPath | 原始压缩包全路径 | 
| [in] | strTargetFullPath | 压缩包解压的临时路径 | 
| [in] | strNewArchiveFullPath | 转换之后的压缩包全路径 | 
| bool DArchiveManager::createArchive | ( | const QList< MgrFileEntry > & | files, | 
| const QString & | strDestination, | ||
| const MgrCompressOptions & | stOptions, | ||
| ArchivePluginType | eType | ||
| ) | 
创建压缩包
| [in] | files | 待压缩文件 | 
| [in] | strDestination | 文件存储在压缩包的路径(为空时,处于根目录) | 
| [in] | stOptions | 压缩参数 | 
| [in] | eType | 插件选择 | 
| bool DArchiveManager::currentStatus | ( | ) | 
当前任务状态
| bool DArchiveManager::deleteFiles | ( | const QString & | strArchiveFullPath, | 
| const QList< MgrFileEntry > & | listSelEntry | ||
| ) | 
删除压缩包中的文件
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | listSelEntry | 当前选中的文件 | 
| bool DArchiveManager::extractFiles | ( | const QString & | strArchiveFullPath, | 
| const QList< MgrFileEntry > & | files, | ||
| const MgrExtractionOptions & | stOptions, | ||
| ArchivePluginType | eType = ArchivePluginType::APT_Auto | ||
| ) | 
解压文件
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | files | 待解压的文件(若数目为空,属于全部解压,否则为提取) | 
| [in] | options | 解压参数 | 
| [in] | eType | 插件选择 | 
| bool DArchiveManager::extractFiles2Path | ( | const QString & | strArchiveFullPath, | 
| const QList< MgrFileEntry > & | listSelEntry, | ||
| const MgrExtractionOptions & | stOptions | ||
| ) | 
提取文件至指定目录
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | listSelEntry | 选中的提取文件 | 
| [in] | stOptions | 提取参数 | 
| 
 | static | 
获取单例实例对象
| QString DArchiveManager::getCurFilePassword | ( | ) | 
获取当前文件密码
| bool DArchiveManager::loadArchive | ( | const QString & | strArchiveFullPath, | 
| ArchivePluginType | eType = ArchivePluginType::APT_Auto | ||
| ) | 
加载压缩包数据
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | eType | 插件选择 | 
| bool DArchiveManager::openFile | ( | const QString & | strArchiveFullPath, | 
| const MgrFileEntry & | stEntry, | ||
| const QString & | strTempExtractPath, | ||
| const QString & | strProgram | ||
| ) | 
打开压缩包中文件
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | stEntry | 待打开文件数据 | 
| [in] | strTempExtractPath | 临时解压路径 | 
| [in] | strProgram | 应用程序名 | 
| bool DArchiveManager::pauseOperation | ( | ) | 
暂停操作
| bool DArchiveManager::renameFiles | ( | const QString & | strArchiveFullPath, | 
| const QList< MgrFileEntry > & | listSelEntry | ||
| ) | 
重命名压缩包中的文件
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | listSelEntry | 当前选中的文件 | 
| 
 | signal | 
信号-当前正在操作的压缩包信号
| strArchiveName | 压缩包名称 | 
| 
 | signal | 
信号-发送当前正在操作的文件名
| strName | 当前文件名 | 
| 
 | signal | 
信号-错误信号
| eErrorType | 错误类型 | 
| 
 | signal | 
信号-发送创建失败的文件名
| strName | 当前文件名 | 
| 
 | signal | 
信号-操作结束信号
| eJobType | job类型 | 
| eFinishType | 结束类型 | 
| eErrorType | 错误类型 | 
| 
 | signal | 
信号-进度信号
| dPercentage | 进度值 | 
| bool DArchiveManager::updateArchiveCacheData | ( | const MgrUpdateOptions & | stOptions | ) | 
更新本地压缩包缓存数据
| [in] | stOptions | 更新选项 | 
| bool DArchiveManager::updateArchiveComment | ( | const QString & | strArchiveFullPath, | 
| const QString & | strComment | ||
| ) | 
更新压缩包注释信息
| [in] | strArchiveFullPath | 压缩包全路径 | 
| [in] | strComment | 注释 |