Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class CecalWriter

    Streams asset files into a .cecal archive with atomic replacement on successful Complete(). See CECAL_FORMAT.md for the on-disk layout.

    Inheritance
    object
    CecalWriter
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 Source

    CecalWriter(string)

    Declaration
    public CecalWriter(string outputPath)
    Parameters
    Type Name Description
    string outputPath

    Methods

    | Edit this page View Source

    AddEntry(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
    | Edit this page View Source

    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()
    | Edit this page View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.