Table of Contents

Interface IResourceImporter

Namespace
ReFuel.IO
Assembly
ReFuel.dll

Interface for all resource loaders.

public interface IResourceImporter

Remarks

Resource importers are expected to be thread safe.

Properties

ImporterExtensions

The file extensions for this resource importer.

IEnumerable<string> ImporterExtensions { get; }

Property Value

IEnumerable<string>

ImporterMimeTypes

The mime types for this resource importer.

IEnumerable<string> ImporterMimeTypes { get; }

Property Value

IEnumerable<string>

ResourceSystem

Set the resource system for this importer.

ResourceSystem ResourceSystem { set; }

Property Value

ResourceSystem

Methods

Import(Stream, EcsContainer?, string?)

Begins importing a resource in the given stream into the given ECS context.

Task<ResourceResult> Import(Stream source, EcsContainer? parent = null, string? fileName = null)

Parameters

source Stream

The resource source stream.

parent EcsContainer

The parent node for file types that contain a node hierarchy. If null, hierarchy is loaded into the root node.

fileName string

Base name of the file.

Returns

Task<ResourceResult>

A task that returns a reference to all the resources in the file.

IsImportable(ReadOnlySpan<byte>, string?)

Checks if this importer could import a stream with the given start bytes.

bool IsImportable(ReadOnlySpan<byte> page, string? fileName = null)

Parameters

page ReadOnlySpan<byte>

The start bytes of the resource stream.

fileName string

The name of the file, as a hint.

Returns

bool

True if the importer could import this file.