IGameFileSystem
Interface IGameFileSystem
Namespace: SwiftlyS2.Shared.FileSystem
Assembly: SwiftlyS2.CS2.dll
public interface IGameFileSystemMethods
AddSearchPath(string, string, SearchPathAdd_t, SearchPathPriority_t)
Adds a search path to the file system.
void AddSearchPath(string path, string pathId, SearchPathAdd_t addType, SearchPathPriority_t priority)- path string — The path to add.
- pathId string — The ID of the path to add in.
- addType SearchPathAdd_t — The type of addition to perform.
- priority SearchPathPriority_t — The priority of the search path.
FileExists(string, string)
Checks if a file exists at the given file path and path ID.
bool FileExists(string filePath, string pathId)- bool — True if the file exists, false otherwise.
FindFileAbsoluteList(string, string)
Finds all files matching the given wildcard and path ID.
List<string> FindFileAbsoluteList(string wildcard, string pathId)- wildcard string — The wildcard to match files against.
- pathId string — The ID of the path to search in.
- List<string> — A list of all files matching the given wildcard and path ID.
GetFileSize(string, string)
Gets the size of a file at the given file path and path ID.
uint GetFileSize(string filePath, string pathId)- filePath string — The path to the file to get the size of.
- pathId string — The ID of the path to get the file size from.
- uint — The size of the file in bytes.
GetSearchPath(string, GetSearchPathTypes_t, int)
Gets the search path(s) for the given path ID and search path type.
string GetSearchPath(string pathId, GetSearchPathTypes_t searchPathType, int searchPathsToGet)- pathId string — The ID of the path to get the search paths for.
- searchPathType GetSearchPathTypes_t — The type of search path to get.
- searchPathsToGet int — The number of search paths to get.
- string — The search path(s) for the given path ID and search path type.
IsDirectory(string, string)
Checks if a directory exists at the given path and path ID.
bool IsDirectory(string path, string pathId)- bool — True if the directory exists, false otherwise.
IsFileWritable(string, string)
Checks if a file is writable at the given file path and path ID.
bool IsFileWritable(string filePath, string pathId)- bool — True if the file is writable, false otherwise.
PrecacheFile(string, string)
Precaches a file at the given file path and path ID.
bool PrecacheFile(string filePath, string pathId)- filePath string — The path to the file to precache.
- pathId string — The ID of the path to precache the file in.
- bool — True if the file was precached successfully, false otherwise.
PrintSearchPaths()
Prints the current search paths to the console.
void PrintSearchPaths()ReadFile(string, string)
Reads the contents of a file at the given file path and path ID.
string ReadFile(string filePath, string pathId)- filePath string — The path to the file to read.
- pathId string — The ID of the path to read the file from.
- string — The contents of the file as a string.
RemoveSearchPath(string, string)
Removes a search path from the file system.
bool RemoveSearchPath(string path, string pathId)- bool — True if the path was removed successfully, false otherwise.
SetFileWritable(string, string, bool)
Sets the writable status of a file at the given file path and path ID.
bool SetFileWritable(string filePath, string pathId, bool writable)- filePath string — The path to the file to set the writable status for.
- pathId string — The ID of the path to set the writable status in.
- writable bool — True to make the file writable, false to make it read-only.
- bool — True if the writable status was set successfully, false otherwise.
WriteFile(string, string, string)
Writes content to a file at the given file path and path ID.
bool WriteFile(string filePath, string pathId, string content)- filePath string — The path to the file to write.
- pathId string — The ID of the path to write the file to.
- content string — The content to write to the file.
- bool — True if the file was written successfully, false otherwise.