Skip to content

Releases: JeevanJames/IniFile

v1.6.0

13 Aug 14:11
Compare
Choose a tag to compare

Change log

  • [#10] Added support for the C# 6 null conditional operator by changing the Ini indexer to return null if the section is not found, instead of throwing the KeyNotFoundException.
// Earlier code
string value = ini.TryGetValue("section", out var section) ? section["property"] : null;
if (value == null)
    // Section does not exist

// With C# 6 null conditional operator
string value = ini["section"]?["property"];
if (value == null)
    // Section does not exist

// Alternate non-C# 6 approach
var section = ini["section"];
string value = section != null ? section["property"] : null;
if (value == null)
    // Section does not exist

v1.5.1

13 Aug 11:33
Compare
Choose a tag to compare

Bug fixes

  • Fix null reference exceptions when loading files from the Ini constructors.

v1.5.0

10 Dec 11:46
Compare
Choose a tag to compare

Change log

  • Added support for reading and writing property values as date/times.

    • Added configuration to control the formatting of date/time values.
  • The AsEnum method now accepts an optional boolean caseSensitive parameter to indicate whether the property value should be case sensitive when reading as an enum. The default is false.

  • Added support for reading multiline property values when loading INI content. This compliments the existing support for writing multiline property values.

v1.4.0

08 Dec 11:26
Compare
Choose a tag to compare

Change log

  • Added support for writing UNIX-style multi-line property values. However, there is currently no support for reading multi-line values.
Property = <<EOT
This is a multi line property.
Here is another line.
EOT
  • Added support for typed property values, with read/write support for booleans, integral numbers, floating-point numbers and strings, and read-only support for enums.

  • Added netstandard2.0 target.

  • Updated exception messages to be more detailed.

Low impact breaking changes

Due to the addition of typed property values, string property values will be returned as type PropertyValue instead of string, if the variable is implicitly declared using var.

// In previous versions, str will be a string
var str = section["Some String"];

// In this new version, str will be a PropertyValue
var str = section["Some String"];

// Explicitly specify variable type to avoid this issue
string str = section["Some String"];

v1.3.0

02 Dec 21:17
Compare
Choose a tag to compare

Change log

  • New global configuration option added using the Ini.Config property.

    • Configs to allow the hash symbol (#) to be used to prefix a comment.
    • Configs to globally set the padding defaults for sections, properties and comments.
  • Added support for .NET 3.5, .NET 4.0 and .NET 4.5 targets.

  • Reduced the netstandard level from netstandard20 to netstandard1.3 to support a wider range of platforms.

  • Section and property names now allow more characters such as :, #, ., ~ and $.

v1.2.0

29 Nov 22:02
Compare
Choose a tag to compare

Change log

  • [Bug fix] - The Property constructor was not assigning the Value property. This has been fixed.

Low impact breaking changes

  • The Section and Property constructors have been changed from accepting a list of MinorIniItem objects (Comment and BlankLine) to a list of strings. Empty or whitespace strings and null values are mapped to BlankLine objects and all remaining strings are mapped to Comment objects.

v1.1.0

28 Nov 21:38
Compare
Choose a tag to compare

Change log

  • Property and Section constructors now optionally accept an initial set of comments and blank lines.
  • Changes to INI formatting (Ini.Format)
    • Formatting removes any trailing blank lines.
    • Added new IniFormatOptions class to specify optional formatting rules for the Ini.Format method.
    • Formatting options to insert blank lines between sections and properties.
    • Formatting option to remove successive blank lines.

Low impact breaking change

  • Removed Left property from Padding class as it is not used by the BlankLine class. Instead, the Left property has been added to the specific padding classes - SectionPadding, PropertyPadding and CommentPadding.