Class CecalWriter
Streams asset files into a .cecal archive with atomic replacement on successful
Complete(). See CECAL_FORMAT.md for the on-disk layout.
Implements
Inherited Members
Namespace: PopcorningGuineaPig.Engine.Assets.Cecal
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public sealed class CecalWriter : IDisposable
Remarks
Usage:
using var writer = new CecalWriter(outputPath);
writer.AddEntry("assets/textures/player.png", absolutePath);
...
writer.Complete();
If Complete() is not called before Dispose(), the .tmp
file is deleted and any existing final file is left untouched.
Constructors
| Edit this page View SourceCecalWriter(string)
Declaration
public CecalWriter(string outputPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | outputPath |
Methods
| Edit this page View SourceAddEntry(string, string)
Streams the bytes of sourcePath into the blob region and
records a TOC entry under logicalPath. The logical path is
normalized to forward slashes; case is preserved.
Declaration
public void AddEntry(string logicalPath, string sourcePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | logicalPath | |
| string | sourcePath |
Complete()
Writes the TOC, patches the header, flushes, closes the temp stream, and atomically renames the temp file over the final output path.
Declaration
public void Complete()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()