Class TgcWriter
- Namespace
- RVZSharp
- Assembly
- RVZSharp.dll
Encodes a GameCube disc image (plain ISO or a legacy format via IBlobReader) into the TGC format (Dolphin: TGCBlob): a 56-byte header carrying the DOL/FST locations, followed by the ISO bytes. The DOL/FST offsets in the header are stored ISO-relative plus the header size, so the decoded image is byte-identical to the input.
public static class TgcWriter
- Inheritance
-
TgcWriter
- Inherited Members
Fields
HeaderSize
Size in bytes of the TGC header structure (0x38).
public const int HeaderSize = 56
Field Value
Methods
Write(IBlobReader, Stream, IProgress<double>?, CancellationToken)
Writes input as a TGC file to output.
public static void Write(IBlobReader input, Stream output, IProgress<double>? progress = null, CancellationToken cancellationToken = default)
Parameters
inputIBlobReaderA GameCube disc image (plain ISO or a legacy container).
outputStreamDestination stream (not disposed by this method).
progressIProgress<double>Optional progress reporter; receives a fraction in [0, 1] of the bytes copied.
cancellationTokenCancellationTokenCancellation is observed between reads.
Exceptions
- ArgumentException
The input is too small to be a disc image.
- RvzFormatException
The input is not a GameCube disc image (the TGC format cannot hold Wii discs).
- OperationCanceledException
The operation was canceled.
Write(string, string, IProgress<double>?, CancellationToken)
Writes the disc image at inputPath (any supported format,
auto-detected by Open(string)) as a TGC file at
outputPath. The output file is created or truncated; a partial
file can remain when the operation fails.
public static void Write(string inputPath, string outputPath, IProgress<double>? progress = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath of a GameCube disc image in any supported format.
outputPathstringPath of the TGC file to create.
progressIProgress<double>Optional progress reporter; receives a fraction in [0, 1] of the bytes copied.
cancellationTokenCancellationTokenCancellation is observed between reads.
Exceptions
- IOException
The input cannot be opened or the output cannot be written.
- ArgumentException
The input is too small to be a disc image.
- RvzFormatException
The input is not a GameCube disc image.
- OperationCanceledException
The operation was canceled.
WriteAsync(IBlobReader, Stream, IProgress<double>?, CancellationToken)
Asynchronous form of Write(IBlobReader, Stream, IProgress<double>?, CancellationToken). The encoder is synchronous and I/O-bound, so the work runs on the thread pool; the returned task completes when the file has been written.
public static Task WriteAsync(IBlobReader input, Stream output, IProgress<double>? progress = null, CancellationToken cancellationToken = default)
Parameters
inputIBlobReaderA GameCube disc image (plain ISO or a legacy container).
outputStreamDestination stream (not disposed by this method).
progressIProgress<double>Optional progress reporter; receives a fraction in [0, 1] of the bytes copied.
cancellationTokenCancellationTokenCancellation is observed between reads.
Returns
- Task
A task that completes when the file has been written.
WriteAsync(string, string, IProgress<double>?, CancellationToken)
Asynchronous form of Write(string, string, IProgress<double>?, CancellationToken).
public static Task WriteAsync(string inputPath, string outputPath, IProgress<double>? progress = null, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath of a GameCube disc image in any supported format.
outputPathstringPath of the TGC file to create.
progressIProgress<double>Optional progress reporter; receives a fraction in [0, 1] of the bytes copied.
cancellationTokenCancellationTokenCancellation is observed between reads.
Returns
- Task
A task that completes when the file has been written.