All Projects → xamarin → LibZipSharp

xamarin / LibZipSharp

Licence: MIT license
A managed wrapper (and then some) around libzip (https://libzip.org/)

Programming Languages

C#
18002 projects
CMake
9771 projects
shell
77523 projects
Batchfile
5799 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to LibZipSharp

Reactor Addons
Official modules for the Reactor project
Stars: ✭ 175 (+525%)
Mutual labels:  mono
Standard.licensing
Easy-to-use licensing library for .NET Framework, Mono, .NET Core, and Xamarin products
Stars: ✭ 239 (+753.57%)
Mutual labels:  mono
xharness
C# command line tool for running tests on Android / iOS / tvOS devices and simulators
Stars: ✭ 123 (+339.29%)
Mutual labels:  mono
Uno.playground
Source code for the Uno Gallery apps and Uno Playground (made in Wasm)
Stars: ✭ 184 (+557.14%)
Mutual labels:  mono
Harmony
A library for patching, replacing and decorating .NET and Mono methods during runtime
Stars: ✭ 2,885 (+10203.57%)
Mutual labels:  mono
gradle-natives
Gradle plugin to aid in managing native libraries associated with Java-based projects.
Stars: ✭ 32 (+14.29%)
Mutual labels:  native-libraries
Rocksdb Sharp
.net bindings for the rocksdb by facebook
Stars: ✭ 173 (+517.86%)
Mutual labels:  mono
SwiftZip
Swift wrapper for libzip — library for reading, creating, and modifying zip archives.
Stars: ✭ 44 (+57.14%)
Mutual labels:  libzip
Pythonnet
Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers.
Stars: ✭ 2,873 (+10160.71%)
Mutual labels:  mono
Dot-Net-Ecosystem
Welcome to the GitHub repository of the .NET Ecosystem. This repository contains the examples for the Pluralsight course: The .NET Ecosystem: The Big Picture. You can download a copy and follow along in the course.
Stars: ✭ 34 (+21.43%)
Mutual labels:  mono
Servicestack.redis
.NET's leading C# Redis Client
Stars: ✭ 2,236 (+7885.71%)
Mutual labels:  mono
Watsontcp
WatsonTcp is the easiest way to build TCP-based clients and servers in C#.
Stars: ✭ 209 (+646.43%)
Mutual labels:  mono
hasura-node-monolith-example
Example of a monolithic web application using Hasura GraphQL Engine + Node.js + Next.js
Stars: ✭ 25 (-10.71%)
Mutual labels:  mono
Arduino Cmdmessenger
CmdMessenger Communication library for Arduino & .NET
Stars: ✭ 175 (+525%)
Mutual labels:  mono
dotnet-web-benchmarks
Benchmarks of popular .net web frameworks
Stars: ✭ 22 (-21.43%)
Mutual labels:  mono
Cppsharp
Tools and libraries to glue C/C++ APIs to high-level languages
Stars: ✭ 2,221 (+7832.14%)
Mutual labels:  mono
PocoDynamo
C# .NET Typed POCO Client for AWS Dynamo DB
Stars: ✭ 39 (+39.29%)
Mutual labels:  mono
profiler-api
The portable version of JetBrains profiler API for .NET Framework / .NET Core / .NET / .NET Standard / Mono
Stars: ✭ 21 (-25%)
Mutual labels:  mono
SparkServer
SparkServer是一个参照skynet设计的C#服务端框架,能够无缝整合到skynet集群机制中,也能自行组网,构建只有SparkServer节点的集群
Stars: ✭ 184 (+557.14%)
Mutual labels:  mono
WhiteCore-Dev
WhiteCoreSim - Software to create your own virtual world
Stars: ✭ 23 (-17.86%)
Mutual labels:  mono

LibZipSharp

A managed wrapper (and then some) around libzip (https://libzip.org/)

Build Status

The core of LibZipSharp is the ZipArchive class. You can use this class to create/extract/update zip file.

Create a new Zip

To create a new archive use the FileMode.CreateNew, this will behave exactly as it does with normal File operations. An exception will be thrown if the file already exists.

using (var zip = ZipArchive.Open ("test.zip", FileMode.CreateNew)) {
}

Open am existing Zip

To open an existing zip file use FileMode.Open.

using (var zip = ZipArchive.Open ("test.zip", FileMode.Open)) {
}

Add files to Zip

There are a number of methods which can be used to add items to the zip file. The simplest is AddFile. This takes a file path. If filename is an absolute path, it will be converted to a relative one by removing the root of the path (i.e. the leading / part on Unix systems and the x:\\ part on Windows). You can also pass an archivePath parameter where you can specify the name/path which file will have within the archive.

using (var zip = ZipArchive.Open ("test.zip", FileMode.CreateNew)) {
    zip.AddFile ("somefile.txt");
}

You can also add data directly from a MemoryStream via the AddEntry method. This takes an entryName and a MemoryStream. Note the MemoryStream will be disposed of when the zip file is finally written to disk.

var ms = new MemoryStream ();
// write data to stream.
using (var zip = ZipArchive.Open ("test.zip", FileMode.CreateNew)) {
    zip.AddEntry ("foo", ms);
}

You can also add text directly via the AddEntry method. This method takes an entryName and text parameters. The entryName defines what the item in the zip file will be called. The text defines the contents on the entry. There is also an encoding parameter where you can define the Encoding of the file.

using (var zip = ZipArchive.Open ("test.zip", FileMode.CreateNew)) {
    zip.AddEntry ("foo", "contents of the file", Encoding.UTF8);
}

Shipping the native libraries.

By default the native libraries will NOT be copied into the output directory of your app. .Net Core apps will pick these files up automatically. However for Mono you will need the libzip.* files in the same directory as the final app for this library to work. Setting the LibZipSharpBundleAllNativeLibraries MSBuild property to true will make sure the native libraries for ALL supported platforms are copied to the output directory.

You can do this via the command line

/p:LibZipSharpBundleAllNativeLibraries=True

or by adding the following to you csproj.

<LibZipSharpBundleAllNativeLibraries>true</LibZipSharpBundleAllNativeLibraries>
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].