Common IO utilities by other SabreTools projects
$ dotnet add package SabreTools.IOThis library compries of I/O functionality used by other SabreTools projects.
Find the link to the Nuget package here.
Below are a list of the included namespaces and their overall utility.
SabreTools.IOGeneric helper classes that involve custom functionality and utility.
SabreTools.IO.CompressionVarious compression implementations that are used across multiple projects. Most of the implementations are be ports of existing C and C++ code.
| Compression Name | Decompress | Compress | Notes |
|---|---|---|---|
| Blast | Yes | No | |
| BZip2 | Yes | Yes | Sourced from DotNetZip |
| Deflate | Yes | Yes | Sourced from DotNetZip |
| LZ | Yes | No | KWAJ, QBasic 4.5, and SZDD variants; KWAJ incomplete |
| LZX | No | No | |
| MSZIP | Yes | No | |
| Quantum | Yes* | No | Partial implementation based on standalone archives; not working |
Note: If something is marked with a * it means that it need testing.
| Library Name | Use |
|---|---|
| DotNetZip | BZip2 and DEFLATE implementations; minor edits have been made |
| ZLibPort | Adds zlib code for internal and external use; minor edits have been made |
SabreTools.IO.EncryptionVarious encryption implementations that are used across multiple projects. Most of the implementations are be ports of existing C and C++ code.
| Encryption Scheme | Encrypt | Decrypt | Notes |
|---|---|---|---|
| AES/CTR | Yes | Yes | Subset of functionality exposed from The Bouncy Castle Cryptography Library For .NET |
| MoPaQ | No | Yes | Used to encrypt and decrypt MoPaQ tables for processing |
SabreTools.IO.ExtensionsExtensions for BinaryReader, byte[], and Stream to help with reading and writing various data types. Some data types are locked behind .NET version support.
This namespace also contains other various extensions that help with common functionality and safe access.
SabreTools.IO.InterfacesCommon interfaces used mainly internal to the library.
| Interface | Notes |
|---|---|
IMatch<T> | Represents a matcher for a generic type |
IMatchSet<T, U> | Represents a set of IMatch<T> types |
SabreTools.IO.LoggingLogic for a logging system, including writing to console and textfile outputs. There are 4 possible log levels for logging statements to be invoked with. There is also a stopwatch implementation included for logging statements with automatic timespan tracking.
SabreTools.IO.MatchingClasses designed to make matching contents and paths easier. These classes allow for both grouped and single matching as well as post-processing of matched information.
SabreTools.IO.Readers and SabreTools.IO.WritersReading and writing support for the following file types:
For a generic INI implementation, see SabreTools.IO.IniFile.
SabreTools.IO.StreamsCustom Stream implementations that are required for specialized use:
BufferedStream: A format that is not a true stream implementation used for buffered, single-byte readsReadOnlyBitStream: A readonly stream implementation allowing bitwise readingReadOnlyCompositeStream: A readonly stream implementation that wraps multiple source streams in a set orderViewStream: A readonly stream implementation representing a view into source dataSabreTools.IO.TransformFile and stream implementations of common data transformations:
SabreTools.NumericsCustom numeric types and related functionality.
| Type Name | Description |
|---|---|
BothInt8 | Both-endian Int8 value |
BothUInt8 | Both-endian UInt8 value |
BothInt16 | Both-endian Int16 value |
BothUInt16 | Both-endian UInt16 value |
BothInt32 | Both-endian Int32 value |
BothUInt32 | Both-endian UInt32 value |
BothInt64 | Both-endian Int64 value |
BothUInt64 | Both-endian UInt64 value |
Both-endian or bi-endian numbers are represented by a little-endian value followed by a big-endian value, where both values are the same number.
SabreTools.Text.CompareClasses focused on string comparison by natural sorting. For example, "5" would be sorted before "100".
For the most recent stable build, download the latest release here: Releases Page
For the latest WIP build here: Rolling Release