-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
IniConfigurationProvider.cs
35 lines (32 loc) · 1.18 KB
/
IniConfigurationProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.IO;
namespace Microsoft.Extensions.Configuration.Ini
{
/// <summary>
/// An INI file based <see cref="ConfigurationProvider"/>.
/// Files are simple line structures (<a href="https://en.wikipedia.org/wiki/INI_file">INI Files on Wikipedia</a>)
/// </summary>
/// <examples>
/// [Section:Header]
/// key1=value1
/// key2 = " value2 "
/// ; comment
/// # comment
/// / comment
/// </examples>
public class IniConfigurationProvider : FileConfigurationProvider
{
/// <summary>
/// Initializes a new instance with the specified source.
/// </summary>
/// <param name="source">The source settings.</param>
public IniConfigurationProvider(IniConfigurationSource source) : base(source) { }
/// <summary>
/// Loads the INI data from a stream.
/// </summary>
/// <param name="stream">The stream to read.</param>
public override void Load(Stream stream)
=> Data = IniStreamConfigurationProvider.Read(stream);
}
}