Reading the configuration file https://code.dlang.org/packages/readconf
Go to file
Alexander Zhirov 0a4bda2efd checks 0.1.6 2023-03-26 02:03:03 +03:00
img v0.1.0 2023-03-24 02:26:02 +03:00
source checks 0.1.6 2023-03-26 02:03:03 +03:00
tests test successfully 0.1.5 2023-03-26 01:45:41 +03:00
.gitignore v0.1.0 2023-03-24 02:26:02 +03:00
LICENSE add license 2023-03-23 18:16:40 +03:00
README.md value6 2023-03-24 08:41:06 +03:00
dub.json test successfully 0.1.5 2023-03-26 01:45:41 +03:00
dub.selections.json v0.1.0 2023-03-24 02:26:02 +03:00
dub.settings.json v0.0.1 2023-03-23 18:10:56 +03:00

README.md

readconf

Singleton for reading the configuration file required for your program.

Quick start

The settings.conf file (see the tests):

matches.png

Read settings.conf file:

import readconf;
import std.stdio;

void main()
{
    Config.file.read("./settings.conf");

    foreach (key, param; Config.file.keys())
        writefln("%s => %s", key, param);

    writeln(Config.file.key("value1"));
}

Result:

value1 => This is the full value
value2 => Take the value in quotation marks
value3 => Or take in apostrophes
value4 => You can also comment
value5 => So you can also comment
value6 => "And you can even do that!"
value7 => 1234567890
value8 => 12345.67890
value9 => You can use large margins
value12 => //path
This is the full value