123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System;
- namespace I2.Loc
- {
- public static class PersistentStorage
- {
- public static void SetSetting_String(string key, string value)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- PersistentStorage.mStorage.SetSetting_String(key, value);
- }
- public static string GetSetting_String(string key, string defaultValue)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.GetSetting_String(key, defaultValue);
- }
- public static void DeleteSetting(string key)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- PersistentStorage.mStorage.DeleteSetting(key);
- }
- public static bool HasSetting(string key)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.HasSetting(key);
- }
- public static void ForceSaveSettings()
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- PersistentStorage.mStorage.ForceSaveSettings();
- }
- public static bool CanAccessFiles()
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.CanAccessFiles();
- }
- public static bool SaveFile(PersistentStorage.eFileType fileType, string fileName, string data, bool logExceptions = true)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.SaveFile(fileType, fileName, data, logExceptions);
- }
- public static string LoadFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.LoadFile(fileType, fileName, logExceptions);
- }
- public static bool DeleteFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.DeleteFile(fileType, fileName, logExceptions);
- }
- public static bool HasFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
- {
- if (PersistentStorage.mStorage == null)
- {
- PersistentStorage.mStorage = new I2CustomPersistentStorage();
- }
- return PersistentStorage.mStorage.HasFile(fileType, fileName, logExceptions);
- }
- private static I2CustomPersistentStorage mStorage;
- public enum eFileType
- {
- Raw,
- Persistent,
- Temporal,
- Streaming
- }
- }
- }
|