ini-parser icon indicating copy to clipboard operation
ini-parser copied to clipboard

Discriminate different configuration data structures

Open rickyah opened this issue 8 years ago • 1 comments

Right now the IniParserConfiguration contains fields that control how to parse a file, how to format a file, or even how an ini file is formed. That data structure should be broke down in three different ones:

IniDefinition This structure will allow to define the format of the INI file by customization the characters used inside the file. Can be used by class IniDataParser to read INI files, and by IniData.ToString() as a format to write a new ini file.

  • char SectionStartChar
  • char SectionEndChar
  • string CommentString
  • char KeyValueAssigmentChar

IniDataFormatting This will allow to configure how to write an ini file to an string. To be passed to IniData.ToString() as a format to write a new ini file.

  • string NewLineStr
  • string AssigmentSpacer
  • bool NewLinesBeforeSection (new property that would fix #121)
  • IniFormatDefinition Format (As this is to be passed to IniData.ToString() method we'll need a reference for the Ini file format)

Ini Parser configuration This defines the behaviour of the parser when reading an ini file

  • Regex CommentRegex
  • Regex SectionRegex
  • bool CaseInsensitive
  • bool AllowKeysWithoutSection
  • bool AllowDuplicateKeys
  • bool OverrideDuplicateKeys
  • bool ConcatenateDuplicateKeys
  • bool ThrowExceptionsOnError
  • bool AllowDuplicateSections
  • bool AllowCreateSectionsOnFly
  • bool SkipInvalidLines

rickyah avatar Feb 19 '17 18:02 rickyah

What’s status on this? There appears to be support in the development branch for some of this, but nuget has not been updated since 2017.

xantari avatar Feb 11 '20 12:02 xantari