Show / Hide Table of Contents

# Interface IConfigProvider

An interface for configuration providers.

###### Namespace: IPA.Config

###### Assembly: IPA.Loader.dll

##### Syntax

    public interface IConfigProvider

##### Remarks

Implementers must provide a default constructor. Do not assume that File will ever be set for a given object.

Implementers are expected to preserve the typing of values passed to Store(Value, FileInfo) when returned from Load(FileInfo). The only exceptions to this are the numeric types, Integer and FloatingPoint, since they can be coerced to each other with AsFloat() and AsInteger() respectively. The provider should however store and recover Integer with as much precision as is possible. For example, a JSON provider may decide to decode all numbers that have an integral value, even if they were originally FloatingPoint, as Integer. This is reasonable, as Integer is more precise, particularly with larger values, than FloatingPoint.

### Properties

| Improve this Doc View Source

#### Extension

Gets the extension without a dot to use for files handled by this provider.

##### Declaration

    string Extension { get; }

##### Property Value

Type | Description
--- | ---
String |

##### Remarks

This must work immediately, and is used to generate the FileInfo used to set File.

### Methods

| Improve this Doc View Source

#### Load(FileInfo)

Loads a Value from disk in whatever format this provider provides and returns it.

##### Declaration

    Value Load(FileInfo file)

##### Parameters

Type | Name | Description
--- | --- | ---
FileInfo | file | the file to read from

##### Returns

Type | Description
--- | ---
Value | the Value loaded

| Improve this Doc View Source

#### Store(Value, FileInfo)

Stores the Value given to disk in the format specified.

##### Declaration

    void Store(Value value, FileInfo file)

##### Parameters

Type | Name | Description
--- | --- | ---
Value | value | the Value to store
FileInfo | file | the file to write to

### Extension Methods

ReflectionUtil.SetField<T, U>(T, String, U)
ReflectionUtil.GetField<U, T>(T, String)
ReflectionUtil.SetProperty<T, U>(T, String, U)
ReflectionUtil.GetProperty<U, T>(T, String)
ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])