@@ -4,7 +4,7 @@ Function: CBA_fnc_getCfgDataHashmap
44
55Description:
66 This function extracts all config properties of a class and returns them as a Hashmap with the properties as keys (string).
7-
7+
88 The following Values will be converted:
99 Boolean as String ("true", "false") will be converted to boolean data-type.
1010
@@ -15,6 +15,7 @@ Parameters:
1515 _condition - Condition for configProperties (optional, default: "true") <STRING>
1616 _inherit - include inherited properties (optional, default: true) <BOOL>
1717 _convert - convert certain values - see above (optional, default: true) <BOOL>
18+ _toLower - applies toLowerANSI to keys of hashmap (optional, default: false) <BOOL>
1819
1920Returns:
2021 properties <HASHMAP> (or <NIL> if _cfg is invalid)
@@ -33,7 +34,8 @@ params [
3334 [" _cfg" , configNull , [configNull ]],
3435 [" _condition" , " true" , [" " ]],
3536 [" _inherit" , true , [true ]],
36- [" _convert" , true , [true ]]
37+ [" _convert" , true , [true ]],
38+ [" _toLower" , false , [true ]]
3739];
3840
3941if ! (isClass _cfg || { isNull _cfg } ) exitWith { nil };
@@ -75,15 +77,15 @@ private _convertCall = [
7577
7678
7779{
78- private _config = _x ;
79-
80- private _value = _x call BIS_fnc_getCfgData call _convertCall ;
80+ private _cfg = _x ;
81+ private _key = if ( _toLower ) then { toLowerANSI configName _cfg } else { configName _cfg };
82+ private _value = _cfg call BIS_fnc_getCfgData call _convertCall ;
8183
8284 _returnHashMap set [
83- configName _x ,
85+ _key ,
8486 _value
8587 ];
86-
88+
8789} forEach _properties ;
8890
8991_returnHashMap // return
0 commit comments