Skip to content

API reference

Class ContentSources

Namespace: MicroEngine.Content
Assembly: MicroEngine.Content.dll
Guide: Assets

Reading from any content source, and opening one from a path.

C#
public static class ContentSources

Inheritance

object ← ContentSources

Methods

Open(string)

The content at path: a folder (FolderContentSource) or a zip archive (ZipContentSource, a file ending in “.zip”).

C#
public static IContentSource Open(string path)

Parameters

path string

Returns

IContentSource

Exceptions

ArgumentException

path is null, empty or white space.

FileNotFoundException

Nothing exists at path, or it is a file other than a zip archive.

InvalidDataException

The file is not a valid zip archive.

ReadAllBytes(IContentSource, string)

Reads the whole file at path.

C#
public static byte[] ReadAllBytes(this IContentSource source, string path)

Parameters

source IContentSource

path string

Returns

byte[]

Exceptions

ArgumentException

The path leaves the source.

FileNotFoundException

No such file, or its name is spelled with another letter case.