public override string GetPath(FSDomain domain, string relativePart = "") { string path = MISC_PATH; switch (domain) { case FSDomain.ConfigFolder: path = persistentDataPath + "/config"; break; case FSDomain.SaveGames: path = persistentDataPath + "/savegame"; break; case FSDomain.ScriptingOutput: path = persistentDataPath + "/scripting"; break; case FSDomain.DevUIViews: path = persistentDataPath + "/dev-ui/views"; break; case FSDomain.DevUIViewsArchieve: path = GetPath(FSDomain.DevUIViews) + "/archives"; break; case FSDomain.RuntimeAssets: path = streamingAssetsPath; break; default: Debug.LogError("UNKNOWN DOMAIN:" + domain.ToString() + " in GetPath! Using MISC-Path"); break; } if (relativePart != "") { // remove leading slashes while (relativePart.StartsWith("/")) { relativePart = relativePart.Substring(1); } } return(EnsureDirectoryExistsAndReturn(path) + (relativePart != ""?"/" + relativePart:"")); }
public override string GetPath(FSDomain domain, string relativePart = "") { string path = MISC_PATH; switch (domain) { case FSDomain.ConfigFolder: path = configPath; break; case FSDomain.SaveGames: path = savegamePath; break; case FSDomain.Scripting: path = scriptingPath; break; case FSDomain.DevUIViews: path = devUIViewsPath; break; case FSDomain.DevUIViewsArchieve: path = GetPath(FSDomain.DevUIViews) + "/archives"; break; case FSDomain.RuntimeAssets: path = streamingAssetsPath; break; case FSDomain.Localizations: path = localizationPath; break; case FSDomain.Debugging: path = debuggingPath; break; case FSDomain.Modding: path = moddingPath; break; case FSDomain.SteamingAssets: path = streamingAssetsPath; break; default: Debug.LogError("UNKNOWN DOMAIN:" + domain.ToString() + " in GetPath! Using MISC-Path"); break; } if (!string.IsNullOrEmpty(relativePart)) { // remove leading slashes while (relativePart.StartsWith("/")) { relativePart = relativePart.Substring(1); } } return(EnsureDirectoryExistsAndReturn(path) + (!string.IsNullOrEmpty(relativePart) ? "/" + relativePart:"")); }
public abstract List <string> GetFilesInDomain(FSDomain domain, string innerDomainPath = "", string filter = "*.*", bool recursive = false);
public abstract byte[] LoadFileAsBytesAtDomain(FSDomain domain, string relativePathToFile, bool compressed = false, int estimatedUncompressedSize = 0);
public override List <string> GetFilesInDomain(FSDomain domain, string innerDomainPath = "", string filter = "*.*") { return(GetFilesInAbsFolder(GetPath(domain, innerDomainPath), filter)); }
public override void RemoveFileInDomain(FSDomain domain, string relativePath) { string path = GetPath(domain, relativePath); RemoveFile(path); }
public override bool FileExistsInDomain(FSDomain domain, string relativePath) { string absPath = GetPath(domain, relativePath); return(FileExists(absPath)); }
public override byte[] LoadFileAsBytesAtDomain(FSDomain domain, string relativePathToFile, bool compressed = false, int estimatedUncompressedSize = 0) { return(LoadFileAsBytes(GetPath(domain) + "/" + relativePathToFile, compressed, estimatedUncompressedSize)); }
public override bool WriteStringToFileAtDomain(FSDomain domain, string relativePathToFile, string data, bool append = false) { relativePathToFile = Utils.CreateValidFilename(relativePathToFile.TrimStart('/')); return(WriteStringToFile(GetPath(domain, relativePathToFile), data, append)); }
public abstract byte[] LoadFileAsBytesAtDomain(FSDomain domain, string relativePathToFile);
public abstract bool WriteStringToFileAtDomain(FSDomain domain, string relativePathToFile, string thedata);
public abstract bool WriteBytesToFileAtDomain(FSDomain domain, string relativePathToFile, byte[] bytes);
public override bool WriteBytesToFileAtDomain(FSDomain domain, string relativePathToFile, byte[] bytes) { return(WriteBytesToFile(GetPath(domain) + "/" + relativePathToFile, bytes)); }
public override bool WriteStringToFileAtDomain(FSDomain domain, string relativePathToFile, string data) { return(WriteStringToFile(GetPath(domain) + "/" + relativePathToFile, data)); }
public abstract void RemoveFileInDomain(FSDomain domain, string relativePath);
public abstract bool FileExistsInDomain(FSDomain domain, string relativePath);
public abstract List <string> GetFilesInDomain(FSDomain domain, string innerDomainPath = "", string filter = "*.*");
public override bool WriteBytesToFileAtDomain(FSDomain domain, string relativePathToFile, byte[] bytes, bool compress = false) { relativePathToFile = Utils.CreateValidFilename(relativePathToFile.TrimStart('/')); return(WriteBytesToFile(GetPath(domain) + "/" + relativePathToFile, bytes, compress)); }
public abstract string GetPath(FSDomain domain, string realtivePart = "");
public override string LoadFileAsStringAtDomain(FSDomain domain, string relativePathToFile) { return(LoadFileAsString(GetPath(domain) + "/" + relativePathToFile)); }
public abstract bool WriteBytesToFileAtDomain(FSDomain domain, string relativePathToFile, byte[] bytes, bool compress = false);
public override List <string> GetFilesInDomain(FSDomain domain, string innerDomainPath = "", string filter = "*.*", bool recursive = false) { return(GetFilesInAbsFolder(GetPath(domain, innerDomainPath), filter, recursive)); }
public abstract bool WriteStringToFileAtDomain(FSDomain domain, string relativePathToFile, string thedata, bool append = false);
public abstract string LoadFileAsStringAtDomain(FSDomain domain, string relativePathToFile);
public override byte[] LoadFileAsBytesAtDomain(FSDomain domain, string relativePathToFile) { return(LoadFileAsBytes(GetPath(domain) + "/" + relativePathToFile)); }