using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SharpChat.Config { public interface IConfig : IDisposable { /// /// Creates a proxy object that forces all names to start with the given prefix. /// IConfig ScopeTo(string prefix); /// /// Reads a raw (string) value from the config. /// string ReadValue(string name, string fallback = null); /// /// Reads and casts value from the config. /// /// Type conversion failed. T ReadValue(string name, T fallback = default); /// /// Reads and casts a value from the config. Returns fallback when type conversion fails. /// T SafeReadValue(string name, T fallback); /// /// Creates an object that caches the read value for a certain amount of time, avoiding disk reads for frequently used non-static values. /// CachedValue ReadCached(string name, T fallback = default, TimeSpan? lifetime = null); } }