Skip to content

Commit d35e0a1

Browse files
committed
docs: add missing descriptions
1 parent d9bd96b commit d35e0a1

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

README.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,29 @@ It does not work with simple compressed streams of data.
2020
You can create a new ZIP archive like this:
2121

2222
```csharp
23-
var zipArchive =
23+
var file =
2424
new ZipExtracted(
2525
new Zipped(
2626
"small.dat", new InputOf("I feel so compressed")
2727
),
2828
"small.dat"
2929
).Stream();
3030
```
31-
31+
or with multiple files
32+
```csharp
33+
new Zipped(
34+
new Dictionary<string, IInput>()
35+
{
36+
{"small.dat", new InputOf("I feel so compressed") },
37+
{"smaller.dat", new InputOf("I'm so compressed") }
38+
}
39+
);
40+
41+
new Zipped(
42+
new KeyValuePair<string, IInput>("small.dat", new InputOf("I feel so compressed")),
43+
new KeyValuePair<string, IInput>("smaller.dat", new InputOf("I'm so compressed"))
44+
);
45+
```
3246
Update a file in the ZIP:
3347

3448
```csharp
@@ -38,6 +52,15 @@ var updated =
3852
"Brave Citizens.txt", new InputOf("Edward Snowden")
3953
).Stream();
4054

55+
```
56+
or add a file to the ZIP if it doesn't exist
57+
```csharp
58+
var updated =
59+
new ZipUpdated(
60+
new Zipped("Brave Citizens.txt", new InputOf("Edward Snowden")),
61+
"Concerned Citizens.txt", new InputOf("Donald")
62+
).Stream();
63+
4164
```
4265

4366
Extract a file in the zip:
@@ -51,7 +74,7 @@ var extracted =
5174
).Stream();
5275
```
5376

54-
List the contents of an archive:
77+
List the contents (directories and files) of an archive:
5578

5679
```csharp
5780
IEnumerable<string> contents =
@@ -60,6 +83,15 @@ IEnumerable<string> contents =
6083
);
6184
```
6285

86+
List all files only of an archive:
87+
88+
```csharp
89+
IEnumerable<string> files =
90+
new ZipFiles(
91+
new InputOf(File.OpenRead("c:/some-zip-archive.zip")),
92+
);
93+
```
94+
6395
Remove a file from the archive:
6496

6597
```csharp
@@ -89,6 +121,16 @@ var isZip =
89121
).Value();
90122
```
91123

124+
Test if a file exists in a zip:
125+
126+
```csharp
127+
var exists =
128+
new ZipContains(
129+
new InputOf(File.OpenRead("c:/some-zip-archive.zip")),
130+
"someFileInTheZip.txt")
131+
).Value();
132+
```
133+
92134
Test if a file in a zip is protected with a password:
93135

94136
```csharp

0 commit comments

Comments
 (0)