|
Revision 128, 0.6 kB
(checked in by KirkMcDonald, 5 years ago)
|
Added module declarations to test modules.
|
| Line | |
|---|
| 1 |
module configtest; |
|---|
| 2 |
|
|---|
| 3 |
import std.stdio : writefln; |
|---|
| 4 |
import std.stream : MemoryStream; |
|---|
| 5 |
import configparse; |
|---|
| 6 |
|
|---|
| 7 |
void main(char[][] args) { |
|---|
| 8 |
auto config = new ConfigParser; |
|---|
| 9 |
config.read("test.ini"); |
|---|
| 10 |
config["name"] = "Kirk"; |
|---|
| 11 |
config.add_section("section1"); |
|---|
| 12 |
config["section1", "foo"] = "bar"; |
|---|
| 13 |
foreach (section; config.sections) { |
|---|
| 14 |
writefln("["~section~"]"); |
|---|
| 15 |
foreach (option; config.options(section)) { |
|---|
| 16 |
writefln("%s = %s", option, config[section, option]); |
|---|
| 17 |
} |
|---|
| 18 |
} |
|---|
| 19 |
config.write("test2.ini"); |
|---|
| 20 |
writefln(config_files(args[0], "foo")); |
|---|
| 21 |
} |
|---|