inilike 1.0.1

Parsing .ini-like files used in Freedesktop systems


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Inilike

Inilike is D library for parsing .ini-like files used in Freedesktop systems in various places (.desktop files, icon themes, mimeapps.list, mimeinfo.cache, trashcan files on freedesktop, etc.)

Build Status Coverage Status

Online documentation

Note: the original purpose of this library is to serve as dependency for my other projects, e.g. desktopfile and icontheme. It may be not suitable to save configuration files using this library. You have been warned.

Format

Freedesktop specifications use the format which is sometimes referred to as .ini-like because it's very similiar to INI used in MS Windows with small differences:

  1. Comments start with '#', not ';'.
  2. Each comment is always placed on its own line. Key-value can't be mixed with a comment on the same line.

Example:

# Comment
[Group name]
Key=Value
# Comment inside group
AnotherKey=Value

[Another group]
Key=English value
Key[fr_FR]=Francais value

Localized values lookup

The localized value is the value associated with the localized key. Localized keys look like this:

keyname[locale]

where locale is the POSIX locale with the charset part dropped.

Inilike library has support for lookup of localized values, using the algorithm described in Desktop Entry Specification.

Subclassing IniLikeFile

IniLikeFile is the base class for file of ini-like format. To change its functionality (validation and other behavior) it needs to be subclassed. See example in unittests that shows which functions can be overridden.

Authors:Roman Chistokhodov

Dependencies: none

Versions:
1.0.1 2016-Sep-26
1.0.0 2016-Sep-10
1.0.0-beta3 2016-Jun-25
1.0.0-beta2 2016-Jun-03
1.0.0-beta 2016-Jun-02
Show all 20 versions
Stats:

statistics are temporarily disabled.