Re: Application settings

2017-07-10 Thread Jacob Carlborg via Digitalmars-d-learn
ad it, or is there a better way? I would say it depends on what kind of application and which platforms it supports. For GUI applications there's usually a native way to store application settings, which will be different on different platforms. For example, on macOS the NSUserDefaults class (S

Re: Application settings

2017-07-08 Thread Timothee Cour via Digitalmars-d-learn
I use protocol buffers (using dproto) for this, storing my settings in either text or wire format. Advantages: type-safety with fwd/backward compatibility (unlike json which requires dynamic field access, eg with dproto you get errors at compile time instead of runtime), supports comments (although

Re: Application settings

2017-07-08 Thread Seb via Digitalmars-d-learn
On Saturday, 8 July 2017 at 05:00:45 UTC, bauss wrote: On Friday, 7 July 2017 at 22:52:22 UTC, FoxyBrown wrote: On Friday, 7 July 2017 at 20:45:36 UTC, Moritz Maxeiner wrote: On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: [...] "best" always depends on your specific use case. I use

Re: Application settings

2017-07-07 Thread bauss via Digitalmars-d-learn
On Friday, 7 July 2017 at 22:52:22 UTC, FoxyBrown wrote: On Friday, 7 July 2017 at 20:45:36 UTC, Moritz Maxeiner wrote: On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save

Re: Application settings

2017-07-07 Thread FoxyBrown via Digitalmars-d-learn
On Friday, 7 July 2017 at 20:45:36 UTC, Moritz Maxeiner wrote: On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save when necessary(possibly be efficient at it, but probably

Re: Application settings

2017-07-07 Thread aberba via Digitalmars-d-learn
On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save when necessary(possibly be efficient at it, but probably doesn't matter). Simply json an array and save and load it,

Re: Application settings

2017-07-07 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save when necessary(possibly be efficient at it, but probably doesn't matter). Simply json an array and save and load it,

Application settings

2017-07-07 Thread FoxyBrown via Digitalmars-d-learn
What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save when necessary(possibly be efficient at it, but probably doesn't matter). Simply json an array and save and load it, or is there a better way? Ideally, I'd like to store th

Re: Application settings

2017-07-07 Thread Cym13 via Digitalmars-d-learn
On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote: What's the "best" way to do this? I want something I can simply load at startup in a convenient and easy way then save when necessary(possibly be efficient at it, but probably doesn't matter). Simply json an array and save and load it,