Chapter 4. Application properties

Application properties are generic configuration settings that are specified in a separate file that gets loaded when the application starts. Individual property settings are retrieved by accessing a separate property object:

#include <x/property_value.H>

static property::value<int> window_width("main::window::width", 400);

// ...

int window_width_value=window_width.get();

This example defines a property named main::window::width. Its value gets specified in the application's property file. If not specified in the property file, its default value is given as 400. get() returns the property's value from the configuration file, or its default value.

LibCXX searches for a default application property file in several places. The the property namespace documentation describes where the application property file comes from, and provides additional examples of using application properties. See also: properties(1).