www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Parameter File reading

reply Vino.B <vino.bheeman hotmail.com> writes:
Hi All,

   Can anyone provide me a example code on how to read a parameter 
file and use those parameter in the program.

From,
Vino.B
Aug 23 2017
next sibling parent biocyberman <biocyberman gmail.com> writes:
On Wednesday, 23 August 2017 at 10:25:48 UTC, Vino.B wrote:
 Hi All,

   Can anyone provide me a example code on how to read a 
 parameter file and use those parameter in the program.

 From,
 Vino.B
Parameter file is a plain text file, with some structure. I've seen in other languages people use YAML file for configuration. So you can also use YAML in D: https://github.com/dlang-community/D-YAML. Check the examples directory for inspiration.
Aug 23 2017
prev sibling next sibling parent Moritz Maxeiner <moritz ucworks.org> writes:
On Wednesday, 23 August 2017 at 10:25:48 UTC, Vino.B wrote:
 Hi All,

   Can anyone provide me a example code on how to read a 
 parameter file and use those parameter in the program.

 From,
 Vino.B
For small tools I use JSON files via asdf[1]. As an example you can look at the tunneled settings structure here[2] and how it's loaded and parsed here[3]; afterwards, you just use the struct as normal in D. [1] https://github.com/tamediadigital/asdf [2] https://github.com/Calrama/tunneled/blob/master/source/tunneled.d#L3 [3] https://github.com/Calrama/tunneled/blob/master/source/tunneled.d#L45
Aug 23 2017
prev sibling parent Seb <seb wilzba.ch> writes:
On Wednesday, 23 August 2017 at 10:25:48 UTC, Vino.B wrote:
 Hi All,

   Can anyone provide me a example code on how to read a 
 parameter file and use those parameter in the program.

 From,
 Vino.B
Another small library: https://github.com/burner/inifiled
Aug 23 2017