This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Config Class

Unigine config.

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

Unigine::Config Class

Members


virtual ~Config ()

Virtual destructor.

static Config * get ()

Returns a pointer to the existing config.

Return value

Pointer to the existing config.

virtual int flush () const =0

Flushes config into the current file.

Return value

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

virtual int load (const char * name) const =0

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.

virtual int save (const char * name) const =0

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.

virtual int isExist (const char * name) const =0

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.

virtual void remove (const char * name) const =0

Removes a parameter with a given name.

Arguments

  • const char * name - Name of the parameter.

virtual void setBool (const char * name, int value) const =0

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.

virtual int getBool (const char * name) const =0

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.

virtual void setInt (const char * name, int value) const =0

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.

virtual int getInt (const char * name) const =0

Returns the current integer value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

Integer value of the parameter.

virtual void setFloat (const char * name, float value) const =0

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.

virtual float getFloat (const char * name) const =0

Returns the current float value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

Float value of the parameter.

virtual void setString (const char * name, const char * value) const =0

Sets a string value of a given parameter.

Arguments

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

virtual const char * getString (const char * name) const =0

Returns the current string value of a given parameter.

Arguments

  • const char * name - Name of the parameter.

Return value

String value of the parameter.
Last update: 2017-07-03
Build: ()