FileManager
ThaumielMapEditor.API.Helpers
Overview​
Methods​
| Signature | Returns | Description |
|---|---|---|
Dir() | string | Gets the Thaumiel directory |
Dir(string[]) | string | Gets the Thaumiel directory plus the inputed directories |
GetFilesInDirectory(string, string) | string[] | Gets all the file paths in the Thaumiel directory combined with the specified di… |
ReadFileInBackground(string, Action<string>) | void | Reads the specified file at the file path in the background. |
TryCreateDirectory(string) | void | Tries to create a directory with the inputted name |
TryCreateDirectory(string[]) | void | Tries to create a directory at the path |
Methods​
Dir​
Dir
public string Dir()
Gets the Thaumiel directory
Returns​
string — Directory path to the Thaumiel directory
Dir​
Dir
public string Dir(string[] path)
Gets the Thaumiel directory plus the inputed directories
Parameters​
| Name | Type | Description |
|---|---|---|
path | string[] | The path of directories |
Returns​
string — Directory path to the Thaumiel directory plus the inputed directories
GetFilesInDirectory​
GetFilesInDirectory
public string[] GetFilesInDirectory(
string name,
string filter
)
Gets all the file paths in the Thaumiel directory combined with the specified directory path.
Parameters​
| Name | Type | Description |
|---|---|---|
name | string | The directory path relative to the Thaumiel directory. |
filter | string | The search pattern to filter files by. Defaults to * which returns all files. |
Returns​
string[] — An array of file paths matching the filter in the resolved directory.
ReadFileInBackground​
ReadFileInBackground
public void ReadFileInBackground(
string path,
Action<string> onComplete
)
Reads the specified file at the file path in the background.
Parameters​
| Name | Type | Description |
|---|---|---|
path | string | |
onComplete | Action<string> | Fired when the reading is complete with the read text |
TryCreateDirectory​
TryCreateDirectory
public void TryCreateDirectory(string name)
Tries to create a directory with the inputted name
Parameters​
| Name | Type | Description |
|---|---|---|
name | string | The name of the directory |
TryCreateDirectory​
TryCreateDirectory
public void TryCreateDirectory(string[] path)
Tries to create a directory at the path
Parameters​
| Name | Type | Description |
|---|---|---|
path | string[] | The directory path to make |