Giter VIP home page Giter VIP logo

libq7zip's Introduction

libq7zip

7-zip library and buildsystems for Qt based applications.

Build and Test

This repository contains source code from the 7-zip and p7zip projects and some classes from the Qt Installer Framework, with CMake and Qmake buildsystems allowing to build static and dynamic libraries for most operating systems and platforms.

This library allows easy and comfortable file and resource compress and uncompress using the 7z format in Qt applications. The following example snippets are taken from the library unit tests.

The default is to build the library for Qt6. There is a cmake option: USE_QT5=ON to link to Qt5 instead.

The unit tests are built by default. If you prefer to not do it, pass the cmake option BUILD_TESTING=OFF.

compress files

#include <q7z_create.h>
#include <q7z_facade.h>

[...]

Q7z::initSevenZ();
QTemporaryFile target;
target.open();
Q7z::createArchive(&target, QStringList() << path1 << path2);

check compressed archive format

#include <q7z_facade.h>

[...]

Q7z::initSevenZ();
bool ok = Q7z::isSupportedArchive("data.7z")

list compressed archive contents

#include <q7z_facade.h>
#include <q7z_list.h>

[...]

Q7z::initSevenZ();
QFile file(":///testdata.7z"); // embedded resource
file.open(QIODevice::ReadOnly);

QVector<Q7z::File> files = Q7z::listArchive(&file);

extract compressed files

#include <q7z_extract.h>
#include <q7z_facade.h>

[...]

Q7z::initSevenZ();
QFile source(":///testdata.7z"); // embedded resource
source.open(QIODevice::ReadOnly);
Q7z::extractArchive(&source, QDir::tempPath());

libq7zip's People

Contributors

pedrolcl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libq7zip's Issues

Releasing the library

This should be done in a way that the exported target will make it possible to use CMake find_package(Q7Zip) from a downstream project, and the library ...

  • can be packaged and distributed in source and binary format
  • can be built and installed to any prefix, and used by other programs
  • can be used directly from the build directory
  • can be embedded as a sub-directory or a git submodule

extract file to root directory?

Hello, I would like to write the 7Z file directly to the root directory, please ask how QFile should point to Sudo permission file to write, such as decompression directory is folder /opt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.