diff options
Diffstat (limited to 'mv_common/src/EngineConfig.cpp')
-rw-r--r-- | mv_common/src/EngineConfig.cpp | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/mv_common/src/EngineConfig.cpp b/mv_common/src/EngineConfig.cpp index 97c8f76..98f5b3f 100644 --- a/mv_common/src/EngineConfig.cpp +++ b/mv_common/src/EngineConfig.cpp @@ -318,38 +318,31 @@ int EngineConfig::cacheDictionaries(bool isLazyCache, std::string configFilePath const char *typeStr = (char*)json_object_get_string_member(attr_obj, "type"); - if(NULL != nameStr && NULL != typeStr) + if (0 == strcmp("double", typeStr)) { - if (0 == strcmp("double", typeStr)) - { - DefDblDict[std::string(nameStr)] = - (double)json_object_get_double_member(attr_obj, "value"); - } - else if (0 == strcmp("integer", typeStr)) - { - DefIntDict[std::string(nameStr)] = - (int)json_object_get_int_member(attr_obj, "value"); - } - else if (0 == strcmp("boolean", typeStr)) - { - DefBoolDict[std::string(nameStr)] = - json_object_get_boolean_member(attr_obj, "value") ? true : false; - } - else if (0 == strcmp("string", typeStr)) - { - const char *valueStr = (char*)json_object_get_string_member(attr_obj, "value"); - - if(NULL != valueStr) - { - DefStrDict[std::string(nameStr)] = valueStr; - } - } - else - { - LOGW("Attribute %i:%s wasn't parsed from json file. " - "Type isn't supported.", attrInd, nameStr); - continue; - } + DefDblDict[std::string(nameStr)] = + (double)json_object_get_double_member(attr_obj, "value"); + } + else if (0 == strcmp("integer", typeStr)) + { + DefIntDict[std::string(nameStr)] = + (int)json_object_get_int_member(attr_obj, "value"); + } + else if (0 == strcmp("boolean", typeStr)) + { + DefBoolDict[std::string(nameStr)] = + json_object_get_boolean_member(attr_obj, "value") ? true : false; + } + else if (0 == strcmp("string", typeStr)) + { + DefStrDict[std::string(nameStr)] = + (char*)json_object_get_string_member(attr_obj, "value"); + } + else + { + LOGW("Attribute %i:%s wasn't parsed from json file. " + "Type isn't supported.", attrInd, nameStr); + continue; } } |