FivePD API
Interfaces

IFileHandlerService

Provides utility methods for file handling.

Methods

LoadStringList

Loads a file's content, splits it by new lines and creates a list from them.

Parameters

NameTypeDescription
pathstringThe path of the file.

Returns

NameType
List<string>A string list, containing each line of the file.

LoadFile

!! IT CAN ONLY DESERIALIZE FROM JSON AND YAML !! Reads the given file. If empty, returns T with its default values. Otherwise returns the data deserialized to the given type.

Parameters

NameTypeDescription
pathstringThe path of the file.
useCacheboolDetermines if the data should be cached.

Returns

NameType
Tuple<T, Exception>The data converted to T.

LoadFile

Reads the given file and returns its content.

Parameters

NameTypeDescription
pathstringThe path of the file.

Returns

NameType
Tuple<bool, string>A tuple with a bool specifying whether the file is JSON or not and the actual content.