Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes

Config Class

Unigine config.

To use this class, include the UnigineConfig.h file.

Notice
Use Console class functions, if you want to change Console variables or execute Console commands.

Config Class

Members


float getFloat (const char * name, float value)

Returns the current float value of a given parameter.

Arguments

  • const char * name - Name of the setting.
  • float value - Custom value to be returned if nothing is found.

Return value

Float value of the parameter.

void setBool (const char * name, int value)

Sets a boolean value of a given parameter. If the parameter with this name already exists, its value is overwritten.

Arguments

  • const char * name - Name of the parameter.
  • int value - Boolean value of the parameter: 0 means FALSE, 1 means TRUE.

void setInt (const char * name, int value)

Sets an integer value of a given parameter. If the parameter with this name already exists, its value is overwritten.

Arguments

  • const char * name - Name of the parameter.
  • int value - Integer value of the parameter.

int getBool (const char * name)

Returns the current boolean value of a given parameter parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

Boolean value of the parameter: 0 means FALSE, 1 means TRUE.

void setString (const char * name, const char * value)

Sets a string value of a given parameter.

Arguments

  • const char * name - Name of the parameter.
  • const char * value - string value of the parameter.

int getInt (const char * name)

Returns the current integer value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

Integer value of the parameter.

const char * getString (const char * name, const char * value)

Returns the current string value of a given parameter.

Arguments

  • const char * name - Name of the setting.
  • const char * value - Custom value to be returned if nothing is found.

Return value

String value of the parameter.

int getInt (const char * name, int value)

Returns the current integer value of a given parameter.

Arguments

  • const char * name - Name of the setting.
  • int value - Custom value to be returned if nothing is found.

Return value

Integer value of the parameter.

void remove (const char * name)

Removes a parameter with a given name.

Arguments

  • const char * name - Name of the parameter.

int save (const char * name)

Saves config into the file.

Arguments

  • const char * name - Config file name.

Return value

Returns 1 if the config is successfully saved into the file; otherwise, 0 is returned.

int getBool (const char * name, int value)

Returns the current boolean value of a given parameter parameter.

Arguments

  • const char * name - Name of the setting.
  • int value - Custom value to be returned if nothing is found.

Return value

Boolean value of the parameter: 0 means FALSE, 1 means TRUE.

int flush ()

Flushes config into the current file.

Return value

Returns 1 if the config is successfully flushed into the file; otherwise, 0.

int load (const char * name)

Loads config from the file.

Arguments

  • const char * name - Config file name.

Return value

Returns 1 if the config is successfully loaded from the file; otherwise, 0 is returned.

int isExist (const char * name)

Checks whether the parameter with a given name exists.

Arguments

  • const char * name - Name of the parameter.

Return value

Returns 1 if the parameter with the given name exists; otherwise, 0.

float getFloat (const char * name)

Returns the current float value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

Float value of the parameter.

const char * getString (const char * name)

Returns the current string value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

String value of the parameter.

void setFloat (const char * name, float value)

Sets a float value of a given parameter. If the parameter with this name already exists, its value is overwritten.

Arguments

  • const char * name - Name of the parameter.
  • float value - Float value of the parameter.
Last update: 2017-07-03