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(L"main::window::width", 400);

// ...

int window_width_value=window_width.getValue();

This example defines a property named main::window::width (identified by a wide character string). Its value gets specified in the application's property file. If not specified in the property file, its default value is given as 400. getValue() 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).