Table of Contents

Class UniFileBase<T>

Namespace
Glitch9.IO.Files
[Serializable]
public abstract class UniFileBase<T> : IUniFile

Type Parameters

T
Inheritance
UniFileBase<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

UniFileBase(UniFileType)

protected UniFileBase(UniFileType fileType)

Parameters

fileType UniFileType

UniFileBase(UniFileType, string, string)

protected UniFileBase(UniFileType fileType, string filePath, string url = null)

Parameters

fileType UniFileType
filePath string
url string

UniFileBase(UniFileType, T)

protected UniFileBase(UniFileType fileType, T value)

Parameters

fileType UniFileType
value T

UniFileBase(UniFileType, T, string, string)

protected UniFileBase(UniFileType fileType, T value, string filePath, string url = null)

Parameters

fileType UniFileType
value T
filePath string
url string

Properties

FileType

public UniFileType FileType { get; set; }

Property Value

UniFileType

IsError

public bool IsError { get; }

Property Value

bool

IsLoaded

public bool IsLoaded { get; }

Property Value

bool

IsLoading

public bool IsLoading { get; }

Property Value

bool

IsValid

public bool IsValid { get; }

Property Value

bool

LastError

public string LastError { get; }

Property Value

string

MimeType

public MIMEType MimeType { get; set; }

Property Value

MIMEType

Name

public string Name { get; }

Property Value

string

Path

Returns the absolute path of the file if it's a local file. Returns the URL if it's a web file.

public string Path { get; set; }

Property Value

string

Url

public string Url { get; set; }

Property Value

string

Value

public T Value { get; set; }

Property Value

T

Methods

EncodeToBase64()

public string EncodeToBase64()

Returns

string

LoadAsync(bool, Action<T>)

public UniTask<T> LoadAsync(bool forceReload = false, Action<T> onLoaded = null)

Parameters

forceReload bool
onLoaded Action<T>

Returns

UniTask<T>

LoadFileAsync()

protected abstract UniTask<T> LoadFileAsync()

Returns

UniTask<T>

ToBinaryData()

public abstract byte[] ToBinaryData()

Returns

byte[]