dprefhandler 0.0.1
Simple D language library for managing and storing of preferences of desktop applications on Windows, Linux and OS X.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
DPrefHandler
WARNING: This library is in the early stage of development!
Simple D language library for managing and storing of preferences of desktop applications (Windows, Linux, OS X)
Usage
Copy dprefhandler.d
source file into your project's directory and perform import dprefhandler;
in a module that would use it.
Build
To build the source code as a library, navigate into project's root directory and run DUB command: dub build
Example
TODO
import dprefhandler;
// Create instance of DPrefHandler
DPrefHandler dph = new DPrefHandler("yourappname");
// Set preferences' names with their default values
dph
.addPref!int("winX", 45)
.addPref!int("winY", 30)
.addPref!bool("fullscreen", false)
.addPref!string("font", "Consolas")
.addPref!size_t("init_array_size", 100)
;
// Load actual values from config file (located in OS user directory)
dph.loadFromFile;
// Change actual values of some preferences
dph.setActualValue!int("winX", 145);
dph.setActualValue!int("winY", 230);
// Save actual values to config file (located in OS user directory)
dph.saveToFile;
- Registered by Žans Kļimovičs
- 0.0.1 released 4 years ago
- zkrolllock/DPrefHandler
- MIT
- Copyright © 2020, Žans Kļimovičs
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.1 2020-Aug-16 ~master 2020-Aug-16 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
10 downloads total
-
- Score:
- 0.5
- Short URL:
- dprefhandler.dub.pm