Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.3.5-preview] - 2024-01-09

### Added
* doc: add "How to Use" section
* doc: add Installation page
  • Loading branch information
Unity Technologies committed Jan 9, 2024
1 parent d54975c commit f5606a1
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.3.5-preview] - 2024-01-09

### Added
* doc: add "How to Use" section
* doc: add Installation page

## [1.3.4-preview] - 2023-04-07

### Added
Expand Down
14 changes: 14 additions & 0 deletions Documentation~/Installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Installation

Follow the following steps to install `com.unity.sharp-zip-lib` package:

1. Make sure git is installed in the system.
1. Open [Package Manager](https://docs.unity3d.com/Manual/upm-ui.html)
1. Click the **+** button, and choose **Add package from git URL**
![](images/PackageManager.png)
1. Type in `com.unity.sharp-zip-lib` and click **Add**.
We can also specify a particular version by appending `@<version>`, for example: `[email protected]`




2 changes: 2 additions & 0 deletions Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* [SharpZipLib](index.md)
* [Installation](Installation.md)
Binary file added Documentation~/images/PackageManager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 48 additions & 2 deletions Documentation~/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,58 @@
# com.unity.sharp-zip-lib

`com.unity.sharp-zip-lib` is a package that wraps [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) to be used inside Unity,
and provides various compression/extraction utility functions.
and provides various compression/uncompression utility functions.

Currently, this packages uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1).
Currently, this package uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1).
Please refer to the [installation](Installation.md) page to install this package.

> The version numbering of this package itself and the version of SharpZipLib used in the package may look similar,
but they are not related.


## How to Use

* All [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) APIs are available under `Unity.SharpZipLib` namespace. For example:
```csharp
using System.IO;
using Unity.SharpZipLib.GZip;

...

public void Foo() {
MemoryStream ms = new MemoryStream();
GZipOutputStream outStream = new GZipOutputStream(ms);
...
}

```

Please refer to the API documentation of the [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) version used
in this package for more details.

* In addition, `com.unity.sharp-zip-lib` also provides additional utility APIs:
* `ZipUtility.CompressFolderToZip()`: Compresses the files in the nominated folder, and creates a zip file on disk.
* `ZipUtility.UncompressFromZip()`: Uncompress the contents of a zip file into the specified folder.

As an example:
```csharp

[Test]
public void Foo() {
//Compress
string tempZipPath = FileUtil.GetUniqueTempPathInProject();
string folderToCompress ="Bar";
ZipUtility.CompressFolderToZip(tempZipPath,null, folderToCompress);

//Uncompress
string tempExtractPath = FileUtil.GetUniqueTempPathInProject();
Directory.CreateDirectory(tempExtractPath);
ZipUtility.UncompressFromZip(tempZipPath, null, tempExtractPath);

}
```


## Supported Unity Versions

* Unity `2018.4.36` or higher.
56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,61 @@
# com.unity.sharp-zip-lib

`com.unity.sharp-zip-lib` is a package that wraps [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) to be used inside Unity,
and provides various compression/extraction utility functions.
and provides various compression/uncompression utility functions.

Currently, this packages uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1).
Currently, this package uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1).
Please refer to the [installation](Documentation~/Installation.md) page to install this package.

> The version numbering of this package itself and the version of SharpZipLib used in the package may look similar,
but they are not related.
EOF


## How to Use

* All [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) APIs are available under `Unity.SharpZipLib` namespace. For example:
```csharp
using System.IO;
using Unity.SharpZipLib.GZip;

...

public void Foo() {
MemoryStream ms = new MemoryStream();
GZipOutputStream outStream = new GZipOutputStream(ms);
...
}

```

Please refer to the API documentation of the [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) version used
in this package for more details.

* In addition, `com.unity.sharp-zip-lib` also provides additional utility APIs:
* `ZipUtility.CompressFolderToZip()`: Compresses the files in the nominated folder, and creates a zip file on disk.
* `ZipUtility.UncompressFromZip()`: Uncompress the contents of a zip file into the specified folder.

As an example:
```csharp

[Test]
public void Foo() {
//Compress
string tempZipPath = FileUtil.GetUniqueTempPathInProject();
string folderToCompress ="Bar";
ZipUtility.CompressFolderToZip(tempZipPath,null, folderToCompress);

//Uncompress
string tempExtractPath = FileUtil.GetUniqueTempPathInProject();
Directory.CreateDirectory(tempExtractPath);
ZipUtility.UncompressFromZip(tempZipPath, null, tempExtractPath);

}
```


## Supported Unity Versions

* Unity `2018.4.36` or higher.
## Steps to update SharpZipLib

### Windows
Expand All @@ -37,4 +85,4 @@ EOF



*Auto-generated on Wed Jul 6 14:13:09 UTC 2022*
*Auto-generated on Tue Jan 9 09:37:14 UTC 2024*
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"displayName": "SharpZipLib",
"name": "com.unity.sharp-zip-lib",
"unity": "2018.4",
"version": "1.3.4-preview",
"version": "1.3.5-preview",
"dependencies": {},
"description": "A package that wraps SharpZipLib (https://github.com/icsharpcode/SharpZipLib) to be used inside Unity",
"contributors": [
"Sindharta Tanuwijaya <[email protected]> (https://github.com/sindharta)"
],
"_upm": {
"changelog": "### Added\n* internal: analytics"
"changelog": "### Added\n* doc: add \"How to Use\" section\n* doc: add Installation page"
},
"upmCi": {
"footprint": "e465b74e38c1e8ee006b84c4e09831805e4443c9"
"footprint": "df804c9234c1ba5e98093a0b6292417aafb38b90"
},
"documentationUrl": "https://docs.unity3d.com/Packages/[email protected]/manual/index.html",
"repository": {
"url": "https://github.com/Unity-Technologies/SharpZipLib.git",
"type": "git",
"revision": "2365f2b7a8ab263a891a9932f7d53d465133b59d"
"revision": "9fc656c1c2a19eed9b5f26574dbb06023f47773b"
}
}

0 comments on commit f5606a1

Please sign in to comment.