IG::IGConfig Class
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Sim
SDK edition to use it.
You should upgrade to
Header: | #include <UnigineIG.h> |
This class is used to manage the IG configuration via API.
IG plugin must be loaded.
IGConfig Class
Enums
CONFIG_FORMAT#
Name | Description |
---|---|
CONFIG_FORMAT_XML = 0 | XML file format. |
CONFIG_FORMAT_JSON = 1 | JSON file format. |
Members
void setValue ( const char * name, int value ) #
Sets the value for the specified parameter.Arguments
- const char * name - Parameter name.
- int value - Integer value to be set.
void setValue ( const char * name, float value ) #
Sets the value for the specified parameter.Arguments
- const char * name - Parameter name.
- float value - Float value to be set.
void setValue ( const char * name, const char * value ) #
Sets the value for the specified parameter.Arguments
- const char * name - Parameter name.
- const char * value - String value to be set.
int getValue ( const char * name, int default_value ) #
Returns the value of the specified parameter. If this parameter has not been specified in the ig_config.xml file, default_value is set for this parameter.Arguments
- const char * name - Parameter name.
- int default_value - A value to be set if the parameter is not specified in the ig_config.xml file.
Return value
Parameter valuefloat getValue ( const char * name, float default_value ) #
Returns the value of the specified parameter. If this parameter has not been specified in the ig_config.xml file, default_value is set for this parameter.Arguments
- const char * name - Parameter name.
- float default_value - A value to be set if the parameter is not specified in the ig_config.xml file.
Return value
Parameter valueString getValue ( const char * name, const char * default_value ) #
Returns the value of the specified parameter. If this parameter has not been specified in the ig_config.xml file, default_value is set for this parameter.Arguments
- const char * name - Parameter name.
- const char * default_value - A value to be set if the parameter is not specified in the ig_config.xml file.
Return value
Parameter valueconst String & getPath ( ) #
Returns the path to the current ig_config.xml file.Return value
Path to the ig_config.xml file.bool load ( const char * filename = "ig_config.xml" ) #
Loads IG configuration from a file with the specified name.Arguments
- const char * filename - Path to the IG configuration file.
Return value
true if the IG configuration is successfully loaded from the specified file; otherwise, false.bool save ( const char * filename, CONFIG_FORMAT format = CONFIG_FORMAT::XML ) #
Saves the IG configuration to the specified file in the specified format (XML or JSON).Arguments
- const char * filename - Path to a file to save the IG configuration to.
- CONFIG_FORMAT format - File format, one of the CONFIG_FORMAT values.
Return value
true if the IG configuration is successfully saved to the specified file; otherwise, false.bool reload ( ) #
Reloads the IG configuration.Return value
true if the IG configuration is successfully reloaded; otherwise, false.void remove ( const char * name ) #
Removes a parameter with the specified name.Arguments
- const char * name - Name of the parameter to be removed.
bool isExist ( const char * name ) #
Returns a value indicating if a parameter with the specified name exists.Arguments
- const char * name - Parameter name.
Return value
true if a parameter with the specified name exists; otherwise, false.Last update:
2020-04-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)