<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On my way back from DConf I was bored with in the in-flight
entertainment and start to hack.<br>
<br>
The result is "inifiled" a compile time ini file reader and writer
that fills and stores a annotated struct.<br>
It excepts typical ini files with sections, comments and to some
extend nesting and arrays. The only <br>
unique characteristic is that the struct and struct member
annotations require comments. Config<br>
options without descriptive comments just make me troll. So comments
for options are required.<br>
<br>
dub: <a class="moz-txt-link-freetext" href="http://code.dlang.org/packages/inifiled">http://code.dlang.org/packages/inifiled</a><br>
github: <a class="moz-txt-link-freetext" href="https://github.com/burner/inifiled">https://github.com/burner/inifiled</a><br>
<br>
<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; margin: 15px 0px; background-color: rgb(248, 248, 248); border: 1px solid rgb(221, 221, 221); line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="nd" style="box-sizing: border-box;">@INI</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"A Person"</span><span class="p" style="box-sizing: border-box;">)</span>
<span class="k" style="box-sizing: border-box; font-weight: bold;">struct</span> <span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">Person</span> <span class="p" style="box-sizing: border-box;">{</span>
<span class="nd" style="box-sizing: border-box;">@INI</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"The lastname of the Person"</span><span class="p" style="box-sizing: border-box;">)</span> <span class="nb" style="box-sizing: border-box; color: rgb(0, 134, 179);">string</span> <span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">lastname</span><span class="p" style="box-sizing: border-box;">;</span>
<span class="nd" style="box-sizing: border-box;">@INI</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"The height of the Person"</span><span class="p" style="box-sizing: border-box;">)</span> <span class="kt" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">float</span> <span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">height</span><span class="p" style="box-sizing: border-box;">;</span>
<span class="nd" style="box-sizing: border-box;">@INI</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"Some strings with a very long long INI description that is longer"</span> <span class="p" style="box-sizing: border-box;">~</span>
<span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">" than eigthy lines hopefully."</span>
<span class="p" style="box-sizing: border-box;">)</span> <span class="nb" style="box-sizing: border-box; color: rgb(0, 134, 179);">string</span><span class="p" style="box-sizing: border-box;">[]</span> <span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">someStrings</span><span class="p" style="box-sizing: border-box;">;
}
</span><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><span class="kt" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">void</span> <span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">main</span><span class="p" style="box-sizing: border-box;">()</span> <span class="p" style="box-sizing: border-box;">{
Person person;
</span><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">readINIFile</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">p</span><span class="p" style="box-sizing: border-box;">,</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"filename.ini"</span><span class="p" style="box-sizing: border-box;">);
</span><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">writeINIFile</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51);">p</span><span class="p" style="box-sizing: border-box;">,</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"filename.ini"</span><span class="p" style="box-sizing: border-box;">);
}
</span></pre>
<br>
</body>
</html>