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
| Name | Type | Description |
|---|---|---|
| path | string | The path of the file. |
Returns
| Name | Type |
|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| path | string | The path of the file. |
| useCache | bool | Determines if the data should be cached. |
Returns
| Name | Type |
|---|---|
| Tuple<T, Exception> | The data converted to T. |
LoadFile
Reads the given file and returns its content.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The path of the file. |
Returns
| Name | Type |
|---|---|
| Tuple<bool, string> | A tuple with a bool specifying whether the file is JSON or not and the actual content. |