All Projects β†’ getnamo β†’ 7zip Cpp

getnamo / 7zip Cpp

Licence: other
Fork of SevenZip++ for modern builds.

Programming Languages

cpp
1120 projects

Labels

Projects that are alternatives of or similar to 7zip Cpp

Minizip Ng
Fork of the popular zip manipulation library found in the zlib distribution.
Stars: ✭ 750 (+689.47%)
Mutual labels:  zip
Zipper
πŸ—³A library to create, read and modify ZIP archive files, written in Swift.
Stars: ✭ 38 (-60%)
Mutual labels:  zip
Iostreams
IOStreams is an incredibly powerful streaming library that makes changes to file formats, compression, encryption, or storage mechanism transparent to the application.
Stars: ✭ 84 (-11.58%)
Mutual labels:  zip
Z1p
Zip Codes Validation and Parse.
Stars: ✭ 17 (-82.11%)
Mutual labels:  zip
Zipstream Php
πŸ’Ύ PHP ZIP Streaming Library
Stars: ✭ 961 (+911.58%)
Mutual labels:  zip
Format parser
file metadata parsing, done cheap
Stars: ✭ 46 (-51.58%)
Mutual labels:  zip
Ugrep
πŸ”NEW ugrep v3.1: ultra fast grep with interactive query UI and fuzzy search: search file systems, source code, text, binary files, archives (cpio/tar/pax/zip), compressed files (gz/Z/bz2/lzma/xz/lz4), documents and more. A faster, user-friendly and compatible grep replacement.
Stars: ✭ 626 (+558.95%)
Mutual labels:  zip
Mzip Android
An Android compress and extract library support popular compression format such as rar, zip
Stars: ✭ 95 (+0%)
Mutual labels:  zip
Http File Server
tiny portable HTTP file server. single binary, no dependencies. linux, osx, windows. #golang
Stars: ✭ 37 (-61.05%)
Mutual labels:  zip
Dareblopy
Data Reading Blocks for Python
Stars: ✭ 82 (-13.68%)
Mutual labels:  zip
Nativexplatform
Akeeba Portable Tools (cross-platform) - Desktop utilities for use with Akeeba Backup and Akeeba Solo
Stars: ✭ 17 (-82.11%)
Mutual labels:  zip
Singlefilez
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a self-extracting HTML/ZIP polyglot file
Stars: ✭ 882 (+828.42%)
Mutual labels:  zip
Zip
Efficient library for manipulating zip archives
Stars: ✭ 69 (-27.37%)
Mutual labels:  zip
Peazip
Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager. Features volume spanning, compression, authenticated encryption. Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PAQ/LPAQ, PEA, QUAD, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard.
Stars: ✭ 827 (+770.53%)
Mutual labels:  zip
Pyfilesystem2
Python's Filesystem abstraction layer
Stars: ✭ 1,256 (+1222.11%)
Mutual labels:  zip
Leanify
lightweight lossless file minifier/optimizer
Stars: ✭ 694 (+630.53%)
Mutual labels:  zip
Shaman.dokan.archive
Mounts 7z/zip/rar files on Windows
Stars: ✭ 41 (-56.84%)
Mutual labels:  zip
Tweetable Polyglot Png
Pack up to 3MB of data into a tweetable PNG polyglot file.
Stars: ✭ 299 (+214.74%)
Mutual labels:  zip
Zippy
Pure Nim implementation of deflate, zlib, gzip and zip.
Stars: ✭ 88 (-7.37%)
Mutual labels:  zip
Archivemounter
Mounts archives like disk images (macOS)
Stars: ✭ 77 (-18.95%)
Mutual labels:  zip

Build status

7zip-cpp

A fork of SevenZip++ for modern builds. Uses cmake to generate build files for desired Visual Studio version, see setup section for instructions.

Uses latest lzma1801 SDK

Notes

Originally from: http://bitbucket.org/cmcnab/sevenzip/wiki/Home

This is a C++ wrapper for accessing the 7-zip COM-like API in 7z.dll and 7za.dll. This code is heavily based off of the Client7z sample found in the LZMA SDK.

The project itself is a static library.

Basic Usage

To use, first load the 7z DLL into memory:

#include <7zpp/7zpp.h>

SevenZip::SevenZipLibrary lib;
lib.Load();

If the appropriate 7z DLL is not in your path you may wish to specify it explicitly in the call to load. Note you may have the 64-bit version installed but are trying to load it from a 32-bit executable; keep that in mind if you encounter errors.

lib.Load(_T("path\\to\\7za.dll"));

Then create and use a compressor:

SevenZip::SevenZipCompressor compressor(lib, archiveName);
compressor.SetCompressionFormat(SevenZip::CompressionFormat::Zip);
compressor.UseAbsolutePaths(false);
compressor.AddFile(targetFile);
compressor.AddDirectory(targetDir);
compressor.DoCompress(callbackfunc);

Or an extractor:

SevenZip::SevenZipExtractor extractor(lib, archiveName);

// Try to detect compression type
if (!extractor.DetectCompressionFormat())
{
	extractor.SetCompressionFormat(SevenZip::CompressionFormat::Zip);
}

...

// Change this function to suit
SevenZip::ProgressCallBack *extractcallbackfunc = nullptr;

...

extractor.ExtractArchive(destination, extractcallbackfunc);

Or a lister:

class ListCallBackOutput : SevenZip::ListCallback
{
	virtual void OnFileFound(WCHAR* path, ULONGLONG size)
	{
		std::wcout
			<< path
			<< L" "
			<< size
			<< std::endl;
	}
};

...

SevenZip::SevenZipLister lister(lib, archiveName);

// Try to detect compression type
if (!lister.DetectCompressionFormat())
{
	lister.SetCompressionFormat(SevenZip::CompressionFormat::Zip);
}

ListCallBackOutput myListCallBack;


lister.ListArchive((SevenZip::ListCallback *)&myListCallBack);

Note: Most of the functions now return a boolean to indicate if it worked instead of throwing an exception.

Otherwise, don't forget to wrap the operations in a try/catch block to handle errors:

...
catch (SevenZip::SevenZipException& ex)
{
    std::cerr << ex.GetMessage() << std::endl;
}
...

Setup and Installation

Using git and cmake

  1. Ensure you have cmake and git installed. Navigate to folder of choice.
  2. Open a powershell window and type git clone https://github.com/getnamo/7zip-cpp.git --recursive
  3. Navigate into the newly cloned project cd 7zip-cpp
  4. (Optional for Test app only) Download and build Boost
  5. Example build with cmake using powershell
cd build
cmake -G "Visual Studio 15 2017 Win64" ../
cmake --build ../build --config Release
  1. Commands from 5 will build win64 Release target and output will be found in build/Release/7zpp.lib

How to use this library in my project

Add project into your cmakelists

add_subdirectory(${pathto7zip-cpp} ${PROJECT_SOURCE_DIR}/build/build7zpp)
target_include_directories(${my_project} INTERFACE ${pathto7zip-cpp}/Include)
target_link_libraries(${my_project} 7zpp)
add_dependencies(${my_project}  7zpp) #might not be necessary

Test Requirements

In order to compile the tests,you must have boost libraries in your path or specify the location where cmake can find them

  1. Assuming you're in the project directory
  2. Download and build Boost
cd build
cmake ../ -DBOOST_ROOT="My boost location"
  1. Then finally cmake --build ../build to build

Known Issues

Only 1 test unit is failing.

Contributing

Read Contributing.md

Branches

  • Devel branch is the bleeding edge, but it should still work.
  • Devel-XXX branches are current topics.
  • Master branch is the latest stable version.
  • More branch information is in Contributing.md.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].