mirror of
https://github.com/SabreTools/SabreTools.IO.git
synced 2026-07-08 17:57:02 +00:00
Stream types get promoted to base IO namespace
This commit is contained in:
24
README.MD
24
README.MD
@@ -14,6 +14,19 @@ Below are a list of the included namespaces and their overall utility.
|
||||
|
||||
Generic helper classes that involve custom functionality and utility.
|
||||
|
||||
#### Classes
|
||||
|
||||
| Class | Notes |
|
||||
| --- | --- |
|
||||
| `BufferedStream` | Not a true stream implementation used for buffered, single-byte reads |
|
||||
| `IniFile` | Key-value pair INI file, implementing `Dictionary<string, string?>` |
|
||||
| `MatchUtil` | Utility class for easier invocation of `SabreTools.Matching` functionality |
|
||||
| `ParentablePath` | Class that represents a path that is rooted by a parent directory |
|
||||
| `PathTool` | Utility class for common Path-related functions |
|
||||
| `ReadOnlyBitStream` | Read-only stream implementation allowing bitwise reading |
|
||||
| `ReadOnlyCompositeStream` | Read-only stream implementation that wraps multiple source streams in a set order |
|
||||
| `ViewStream` | Read-only stream implementation representing a view into source data |
|
||||
|
||||
### `SabreTools.IO.Compression`
|
||||
|
||||
Various compression implementations that are used across multiple projects. Most of the implementations are be ports of existing C and C++ code.
|
||||
@@ -59,15 +72,6 @@ Reading and writing support for the following file types:
|
||||
|
||||
For a generic INI implementation, see `SabreTools.IO.IniFile`.
|
||||
|
||||
### `SabreTools.IO.Streams`
|
||||
|
||||
Custom `Stream` implementations that are required for specialized use:
|
||||
|
||||
- `BufferedStream`: A format that is not a true stream implementation used for buffered, single-byte reads
|
||||
- `ReadOnlyBitStream`: A readonly stream implementation allowing bitwise reading
|
||||
- `ReadOnlyCompositeStream`: A readonly stream implementation that wraps multiple source streams in a set order
|
||||
- `ViewStream`: A readonly stream implementation representing a view into source data
|
||||
|
||||
### `SabreTools.IO.Transform`
|
||||
|
||||
File and stream implementations of common data transformations:
|
||||
@@ -90,7 +94,7 @@ Classes designed to make matching contents and paths easier. These classes allow
|
||||
#### Matching Classes
|
||||
|
||||
| Class | Implements | Notes |
|
||||
| --- | --- |
|
||||
| --- | --- | --- |
|
||||
| `ContentMatch` | `IMatch<byte?[]>` | Matches contents of a byte array, allowing wildcard bytes using `null` |
|
||||
| `ContentMatchSet` | `IMatchSet<ContentMatch, byte?[]>` | Group of logically-linked `ContentMatch` |
|
||||
| `FilePathMatch` | `IMatch<string>` | Specialization of `PathMatch` that assumes the string is a filename |
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace SabreTools.IO.Test.Streams
|
||||
public void ReadNextByte_Empty_Null()
|
||||
{
|
||||
var source = new MemoryStream();
|
||||
var stream = new IO.Streams.BufferedStream(source);
|
||||
var stream = new BufferedStream(source);
|
||||
byte? actual = stream.ReadNextByte();
|
||||
Assert.Null(actual);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace SabreTools.IO.Test.Streams
|
||||
public void ReadNextByte_Filled_ValidPosition_Byte()
|
||||
{
|
||||
var source = new MemoryStream(new byte[1024]);
|
||||
var stream = new IO.Streams.BufferedStream(source);
|
||||
var stream = new BufferedStream(source);
|
||||
byte? actual = stream.ReadNextByte();
|
||||
Assert.Equal((byte)0x00, actual);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace SabreTools.IO.Test.Streams
|
||||
{
|
||||
var source = new MemoryStream(new byte[1024]);
|
||||
source.Seek(0, SeekOrigin.End);
|
||||
var stream = new IO.Streams.BufferedStream(source);
|
||||
var stream = new BufferedStream(source);
|
||||
byte? actual = stream.ReadNextByte();
|
||||
Assert.Null(actual);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using SabreTools.IO.Streams;
|
||||
using Xunit;
|
||||
|
||||
namespace SabreTools.IO.Test.Streams
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using SabreTools.IO.Streams;
|
||||
using Xunit;
|
||||
|
||||
namespace SabreTools.IO.Test.Streams
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using SabreTools.IO.Streams;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable IDE0017 // Object initialization can be simplified
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using SabreTools.IO.Streams;
|
||||
using static SabreTools.IO.Compression.Quantum.Constants;
|
||||
|
||||
namespace SabreTools.IO.Compression.Quantum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.IO;
|
||||
|
||||
namespace SabreTools.IO.Streams
|
||||
namespace SabreTools.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Buffered stream that reads in blocks
|
||||
@@ -2,7 +2,7 @@ using System.Data;
|
||||
using System.IO;
|
||||
using SabreTools.IO.Extensions;
|
||||
|
||||
namespace SabreTools.IO.Streams
|
||||
namespace SabreTools.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper to allow reading bits from a source stream
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
namespace SabreTools.IO.Streams
|
||||
namespace SabreTools.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Read-only stream wrapper around multiple, consecutive streams
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace SabreTools.IO.Streams
|
||||
namespace SabreTools.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Stream representing a view into a source
|
||||
Reference in New Issue
Block a user