Table of Contents

Class DirectoryAssetSource

Namespace
Shard.Assets
Assembly
Shard.Assets.dll

Reads assets from a directory through source-neutral relative paths.

public sealed class DirectoryAssetSource : IAssetSource
Inheritance
DirectoryAssetSource
Implements
Inherited Members

Constructors

DirectoryAssetSource(string)

public DirectoryAssetSource(string root)

Parameters

root string

Methods

EnumerateFiles(string)

public IEnumerable<AssetFile> EnumerateFiles(string prefix)

Parameters

prefix string

Returns

IEnumerable<AssetFile>

OpenRead(string)

public Stream OpenRead(string relativePath)

Parameters

relativePath string

Returns

Stream

TryGetFile(string, out AssetFile)

public bool TryGetFile(string relativePath, out AssetFile file)

Parameters

relativePath string
file AssetFile

Returns

bool

TryOpenRead(string, out Stream?)

public bool TryOpenRead(string path, out Stream? stream)

Parameters

path string
stream Stream

Returns

bool