Latest version:
Tramway SDK 0.0.9
Github
Quick links
Home
Get Started

Settings


The settings system can be used to save your application's settings, as well as automatically parse command line options.

Programming in C++


#include <framework/settings.h>
API documentation page.

Settings can be registered in two different ways. In the first, the settings system will store the setting for you. In the second, you provide a pointer to the setting and manage the storage yourself.

// allowing settings to manage the setting
Settings::Register(420, "frog-count");

// managing our own setting
uint32_t frog_count = 420;
Settings::Register(&frog_count, "frog-count");

Parsing settings from commandline is very simple.

int main(const char** argv, int argc) {
    Settings::Parse(argv, argc);

    return 0;
}

Settings can also be saved to disk and loaded back up.

Settings::Save("frog-settings");
Settings::Load("frog-settings");