Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class CompositeVirtualFileSystem

    Tries each layered VFS in order and returns the first hit. Used at runtime to resolve assets from the packed .cecal archive first, then fall through to loose files on disk — so developers can drop a replacement file next to the build output and override the packed copy without rebuilding the archive.

    Inheritance
    object
    CompositeVirtualFileSystem
    Implements
    IVirtualFileSystem
    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 CompositeVirtualFileSystem : IVirtualFileSystem, IDisposable

    Constructors

    | Edit this page View Source

    CompositeVirtualFileSystem(params IVirtualFileSystem[])

    Declaration
    public CompositeVirtualFileSystem(params IVirtualFileSystem[] layers)
    Parameters
    Type Name Description
    IVirtualFileSystem[] layers

    Methods

    | Edit this page View Source

    Dispose()

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

    Declaration
    public void Dispose()
    | Edit this page View Source

    Exists(string)

    Returns true if logicalPath can be resolved by this VFS. Does not open the asset; use TryOpen(string, out Stream) for that.

    Declaration
    public bool Exists(string logicalPath)
    Parameters
    Type Name Description
    string logicalPath
    Returns
    Type Description
    bool
    | Edit this page View Source

    ResolveDirectoryToTemp(string)

    Extracts all entries whose logical path starts with the given directory prefix to temp files, preserving relative directory structure. Required for formats like GLTF that reference companion files (.bin, textures) via relative URIs. No-op for implementations that serve files directly from disk.

    Declaration
    public void ResolveDirectoryToTemp(string directoryPrefix)
    Parameters
    Type Name Description
    string directoryPrefix
    | Edit this page View Source

    ResolveToTempFile(string)

    Resolves the asset to an absolute filesystem path that a native loader (e.g. Raylib.LoadModel) can consume directly. Packed implementations extract to a cached temp file; loose implementations return the asset's on-disk location unchanged. Returns null on miss.

    Declaration
    public string? ResolveToTempFile(string logicalPath)
    Parameters
    Type Name Description
    string logicalPath
    Returns
    Type Description
    string
    Remarks

    This exists because raylib-cs 7.0.1 has no LoadModelFromMemory and OwnAudioNET's FileSource accepts only a file path. Temp files are cached for the process lifetime and cleaned up on exit.

    | Edit this page View Source

    TryOpen(string, out Stream)

    Opens a read-only, seekable Stream over the asset bytes. The caller owns the stream and must dispose it. Returns false on miss.

    Declaration
    public bool TryOpen(string logicalPath, out Stream stream)
    Parameters
    Type Name Description
    string logicalPath
    Stream stream
    Returns
    Type Description
    bool
    | Edit this page View Source

    TryReadAllBytes(string, out byte[])

    Reads the entire asset into a new byte array. Returns false on miss.

    Declaration
    public bool TryReadAllBytes(string logicalPath, out byte[] bytes)
    Parameters
    Type Name Description
    string logicalPath
    byte[] bytes
    Returns
    Type Description
    bool
    | Edit this page View Source

    TryReadAllText(string, out string)

    Reads the entire asset as UTF-8 text. Returns false on miss.

    Declaration
    public bool TryReadAllText(string logicalPath, out string text)
    Parameters
    Type Name Description
    string logicalPath
    string text
    Returns
    Type Description
    bool

    Implements

    IVirtualFileSystem
    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.