using System; // ReSharper disable UnusedMember.Global namespace IPA.Config { /// /// An interface for configuration providers. /// public interface IConfigProvider { /// /// Loads the data provided by this into an object of type . /// /// the type of the object to parse into /// the values from the config provider parsed into the object T Parse(); /// /// Stores the data from into the . /// /// the type of /// the object containing the data to save void Store(T obj); /// /// Gets a dynamic object providing access to the configuration. /// dynamic Dynamic { get; } #region State getters /// /// Returns if object has changed since the last save /// bool HasChanged { get; } /// /// Returns if the data in memory has been changed - notably including loads. /// bool InMemoryChanged { get; set; } /// /// Will be set with the filename (no extension) to save to. When saving, the implementation should add the appropriate extension. Should error if set multiple times. /// string Filename { set; } /// /// Gets the last time the config was modified. /// DateTime LastModified { get; } /// /// Saves configuration to file. Should error if not a root object. /// void Save(); /// /// Loads the state of the file on disk. /// void Load(); #endregion } }