tools:config
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tools:config [2017/12/14 08:01] – graf | tools:config [2018/01/12 09:28] – graf | ||
---|---|---|---|
Line 13: | Line 13: | ||
add(" | add(" | ||
add(" | add(" | ||
- | add("init values", c); | + | add("initValues", c); |
add(" | add(" | ||
} | } | ||
Line 24: | Line 24: | ||
When such a configuration class object is created, its values are initialized with default values. | When such a configuration class object is created, its values are initialized with default values. | ||
+ | <code cpp> | ||
+ | TestConfig configFile(" | ||
+ | </ | ||
+ | However, if a configuration file exists at the given location, you can load the values from there and overwrite these default values with the values given in the file. | ||
+ | <code cpp> | ||
+ | TestConfig configFile(" | ||
+ | configFile.load(); | ||
+ | </ | ||
+ | WARNING Valid name for the identifiers of the values include numbers and letters only, no spaces, underlines or dots. ' | ||
+ | You can manually create a suitable configuration file at the given location, e.g. | ||
+ | < | ||
+ | id = 1 | ||
+ | offset = 2.200000 | ||
+ | initValues = 0.1, 0.4, 0.3 | ||
+ | ip = 127.0.0.0 | ||
+ | </ | ||
+ | or you could save the values of your configuration class object into the file (and possible change an existing content). | ||
+ | <code cpp> | ||
+ | configFile.save(); | ||
+ | </ | ||
+ | It's also possible to save to or restore from another file by writing: | ||
+ | <code cpp> | ||
+ | configFile.save(" | ||
+ | configFile.load(" | ||
+ | </ |
tools/config.txt · Last modified: 2020/12/03 12:01 by ursgraf