libzip开发笔记(一):libzip库介绍、编译和工程模板

简介: libzip开发笔记(一):libzip库介绍、编译和工程模板

前言

  Qt使用一些压缩解压功能,选择libzip库,libzip库比较原始,也是很多其他库的基础支撑库。


libzip

  libzip是一个C库,用于读取,创建和修改zip档案。可以从数据缓冲区,文件或直接从其他zip归档文件直接复制的压缩数据中添加文件。在不关闭存档的情况下所做的更改可以还原。

  当前版本是1.7.3,于2020年7月15日发布。

  官网:https://libzip.org/

  QQ群:1047134658(点击“文件”搜索“libzip”,群内与博文同步更新)


libzip编译

步骤一:解压

步骤二:Cmake配置(vs2017 x64版本)

  需要zlib,之前已经编译过vs2017 x64版本的zlib了,导入再配置

步骤三:生成工程

步骤四:打开VS2017编译

步骤五:安装install


模块化


补充:查看命令行工具帮助和源码辅助开发

ziptool.exe -h
usage: ziptool.exe [-ceghnrst] [-l len] [-o offset] archive command1 [args] [command2 [args] ...]
Supported options are:
        -c              check consistency
        -e              error if archive already exists (only useful with -n)
        -g              guess file name encoding (for stat)
        -h              display this usage
        -l len          only use len bytes of file
        -n              create archive if it doesn't exist
        -o offset       start reading file at offset
        -r              print raw file name encoding without translation (for stat)
        -s              follow file name convention strictly (for stat)
        -t              disregard current archive contents, if any
Supported commands and arguments are:
        add name content
            add file called name using content
        add_dir name
            add directory
        add_file name file_to_add offset len
            add file to archive, len bytes starting from offset
        add_from_zip name archivename index offset len
            add file from another archive, len bytes starting from offset
        cat index
            output file contents to stdout
        count_extra index flags
            show number of extra fields for archive entry
        count_extra_by_id index extra_id flags
            show number of extra fields of type extra_id for archive entry
        delete index
            remove entry
        delete_extra index extra_idx flags
            remove extra field
        delete_extra_by_id index extra_id extra_index flags
            remove extra field of type extra_id
        get_archive_comment
            show archive comment
        get_extra index extra_index flags
            show extra field
        get_extra_by_id index extra_id extra_index flags
            show extra field of type extra_id
        get_file_comment index
            get file comment
        get_num_entries flags
            get number of entries in archive
        name_locate name flags
            find entry in archive
        print_progress
            print progress during zip_close()
        rename index name
            rename entry
        replace_file_contents index data
            replace entry with data
        set_archive_comment comment
            set archive comment
        set_extra index extra_id extra_index flags value
            set extra field
        set_file_comment index comment
            set file comment
        set_file_compression index method compression_flags
            set file compression method
        set_file_dostime index time date
            set file modification time and date (DOS format)
        set_file_encryption index method password
            set file encryption method
        set_file_mtime index timestamp
            set file modification time
        set_file_mtime_all timestamp
            set file modification time for all files
        set_password password
            set default password for encryption
        stat index
            print information about entry
Supported flags are:
        0       (no flags)
        C       ZIP_FL_NOCASE
        c       ZIP_FL_CENTRAL
        d       ZIP_FL_NODIR
        l       ZIP_FL_LOCAL
        u       ZIP_FL_UNCHANGED
Supported compression methods are:
        default
        deflate
        store
Supported encryption methods are:
        none
        AES-128
        AES-192
        AES-256
        PKWARE
The index is zero-based.


工程模板v1.0.0

  对应工程模板:zipDemo_v1.0.0_基础模板_zip库的基础环境.rar


相关文章
|
10月前
|
JavaScript
若依代码生成自带导入功能
若依代码生成自带导入功能
330 0
|
4月前
|
SQL JSON Dart
Dart笔记:一些代码生成工具站点的介绍
Dart笔记:一些代码生成工具站点的介绍
75 0
|
5月前
|
C++ 计算机视觉
Visual Studio新项目快速配置已有项目中编译好的C++第三方库的方法
Visual Studio新项目快速配置已有项目中编译好的C++第三方库的方法
|
6月前
|
JavaScript 前端开发 Cloud Native
云his源码 多院区集团化的全院HIS系统源代码
系统利用云计算平台的技术优势,建立统一的云HIS、云病历、云LIS,有效实现实现协同门诊、住院、药房药库管理、双向转诊转检、远程会诊诊断及医疗数据共享与交换,解决数据重复采集及信息孤岛等问题,为实现区域协同医疗卫生信息化平台奠定了基础。 系统技术特点:采用前后端分离架构,前端由Angular语言、JavaScript开发;后端使用Java语言开发,适用于二级医院、基层医疗机构,可作为区域HIS使用,经扩展后能够应用于医联体/医共体。 云病历:完全满足和符合国家电子病历评级标准。三级质控,病历留痕,续打,批注
|
9月前
|
C++
2022-9-28-CMAKE工程中Cmakelist文档编写的一些注意点
2022-9-28-CMAKE工程中Cmakelist文档编写的一些注意点
87 0
|
IDE 开发工具 C++
MDK5软件入门之——基础工程创建及下载和调试
MDK5软件入门之——基础工程创建及下载和调试
308 0
MDK5软件入门之——基础工程创建及下载和调试
|
IDE 开发工具 iOS开发
CMake教程13:美化构建后的项目工程结构
CMake教程13:美化构建后的项目工程结构
473 0
|
Unix Linux Windows
Qwt开发笔记(一):Qwt简介、下载以及基础demo工程模板
QWT开发笔记系列整理集合,这是目前使用最为广泛的Qt图表类(Qt的QWidget代码方向只有QtCharts,Qwt,QCustomPlot),使用多年,系统性的整理,本系列旨在系统解说并逐步更新其各种Demo示例。
Qwt开发笔记(一):Qwt简介、下载以及基础demo工程模板
|
程序员 Android开发 开发者
Android开发:往项目工程里面新引入工具包的步骤
在Android开发过程中,有些时候会根据实际需要,要往项目里面引入工具包,作为初级开发者或者刚开始入门的Android开发者来说会不太熟练怎么引入,所以往项目工程里面新引入工具包也是必备技能。那么本篇博文就来分享一下给项目工程里面引入工具包的步骤,只分享给有需要的人。
163 0
Android开发:往项目工程里面新引入工具包的步骤
|
网络协议 Linux Windows
LibModbus库开发笔记(一):libmodbus库介绍、编译和基础工程模板
LibModbus库开发笔记(一):libmodbus库介绍、编译和基础工程模板
LibModbus库开发笔记(一):libmodbus库介绍、编译和基础工程模板