BadScript 2
Loading...
Searching...
No Matches
BadCompressionApi.cs
Go to the documentation of this file.
1using BadScript2.IO;
4
9
13[BadInteropApi("Compression", true)]
14internal partial class BadCompressionApi
15{
19 private readonly IFileSystem? m_FileSystem;
20
21
26 public BadCompressionApi(IFileSystem fileSystem) : this()
27 {
28 m_FileSystem = fileSystem;
29 }
30
31
32 protected override void AdditionalData(BadTable target)
33 {
34 BadTable zip = new BadTable();
35 BadTable gzip = new BadTable();
36 BadTable deflate = new BadTable();
37 BadTable zlib = new BadTable();
38 BadTable base64 = new BadTable();
39 target.SetProperty("Zip", zip);
40 target.SetProperty("GZip", gzip);
41 target.SetProperty("Deflate", deflate);
42 target.SetProperty("ZLib", zlib);
43 target.SetProperty("Base64", base64);
44 new BadZipApi(m_FileSystem ?? BadFileSystem.Instance).LoadRawApi(zip);
45 new BadGZipApi().LoadRawApi(gzip);
46 new BadDeflateApi().LoadRawApi(deflate);
47 new BadZLibApi().LoadRawApi(zlib);
48 new BadBase64Api().LoadRawApi(base64);
49 }
50}
Public interface for the filesystem abstraction of the BadScript Engine.
static IFileSystem Instance
File System implementation.
readonly? IFileSystem m_FileSystem
The FileSystem Instance.
BadCompressionApi(IFileSystem fileSystem)
Creates a new API Instance.
Implements an Interop API for the BS2 Language.
Implements a Table Structure for the BadScript Language.
Definition BadTable.cs:14
Defines the interface for a file system.
Definition IFileSystem.cs:7
Contains IO Implementation for the BadScript2 Runtime.
Contains Compression Extensions and APIs for the BadScript2 Runtime.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10