This page has been translated automatically.
编程
Fundamentals
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
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Config Class

Header:#include <UnigineConfig.h>

Reads values (settings) from the configuration file and writes back into it.

Config Class

Members


Config * get()

Returns a pointer to the existing Config instance.

Return value

A pointer to the Config instance.

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.

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.

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 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.

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.

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.

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.

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 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.

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 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.

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.

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.

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.

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.
Last update: 2017-07-03
Build: ()