Graphite  Version 3
An experimental 3D geometry processing program
OGF::Preferences Namespace Reference

Utility functions to manipulate preferences. More...

Functions

void save_preferences ()
 Saves the preferences. More...
 
void declare_preference_variable (const std::string &name)
 Declares a variable as a preference variables. More...
 
void declare_preference_variable (const std::string &name, const char *value, const std::string &help="")
 Declares a variable as a preference variables. More...
 
bool preference_variable_is_declared (const std::string &name)
 Tests whether a variable is declared as a preference variable. More...
 
void declare_preference_variable (const std::string &name, int value, const std::string &help="")
 Declares a variable as a preference variables. More...
 
void declare_preference_variable (const std::string &name, bool value, const std::string &help="")
 Declares a variable as a preference variables. More...
 

Detailed Description

Utility functions to manipulate preferences.

Function Documentation

◆ declare_preference_variable() [1/4]

void OGF::Preferences::declare_preference_variable ( const std::string &  name)

Declares a variable as a preference variables.

Preference variables are stored in the GEO::Environment. Variables that are declared as preference variables are loaded/saved from/into the preferences file.

Parameters
[in]namethe name of the variable, that should have already been declared using CmdLine::declare_arg()

◆ declare_preference_variable() [2/4]

void OGF::Preferences::declare_preference_variable ( const std::string &  name,
bool  value,
const std::string &  help = "" 
)

Declares a variable as a preference variables.

Preference variables are stored in the GEO::Environment. Variables that are declared as preference variables are loaded/saved from/into the preferences file.

Parameters
[in]namename of the preference variable
[in]valuethe initial value of the preference variable
[in]helpan optional description to be displayed when invoking graphite /? or graphite -h

◆ declare_preference_variable() [3/4]

void OGF::Preferences::declare_preference_variable ( const std::string &  name,
const char *  value,
const std::string &  help = "" 
)

Declares a variable as a preference variables.

Preference variables are stored in the GEO::Environment. Variables that are declared as preference variables are loaded/saved from/into the preferences file. Note: value argument is declared as const char* rather than const std::string& because this function is used with string literals and the C++ compiler finds that it is easier to convert a string literal to a boolean than to a std::string.

Parameters
[in]namename of the preference variable
[in]valuethe initial value of the preference variable
[in]helpan optional description to be displayed when invoking graphite /? or graphite -h

◆ declare_preference_variable() [4/4]

void OGF::Preferences::declare_preference_variable ( const std::string &  name,
int  value,
const std::string &  help = "" 
)

Declares a variable as a preference variables.

Preference variables are stored in the GEO::Environment. Variables that are declared as preference variables are loaded/saved from/into the preferences file.

Parameters
[in]namename of the preference variable
[in]valuethe initial value of the preference variable
[in]helpan optional description to be displayed when invoking graphite /? or graphite -h

◆ preference_variable_is_declared()

bool OGF::Preferences::preference_variable_is_declared ( const std::string &  name)

Tests whether a variable is declared as a preference variable.

See also
declare_preference_variable()
Parameters
[in]namename of the preference variable
Return values
trueif the preference variable is declared.
falseotherwise.

◆ save_preferences()

void OGF::Preferences::save_preferences ( )

Saves the preferences.

Preferences are saved to home directory/graphite.ini