Index: src/libchcore/ConfigNodeContainer.cpp =================================================================== diff -u -N -r8a2ff3b2b71b45fb525e030167e62f316cb32869 -rfb2161f6abec049da07b234f15229d008412fc8f --- src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 8a2ff3b2b71b45fb525e030167e62f316cb32869) +++ src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision fb2161f6abec049da07b234f15229d008412fc8f) @@ -442,8 +442,8 @@ if (stChildCount != stNodeNamesCount && stNodeNamesCount != 1) throw TCoreException(eErr_InvalidData, L"Tree sanity check failed", LOCATION); - enum EMode { eMode_LeafStringArrayEntries, eMode_LeafOrContainer, eMode_ContainerSplit, eMode_ContainerPassThrough }; - EMode eMode = eMode_LeafStringArrayEntries; + enum EMode { eMode_LeafStringArrayEntries, eMode_LeafOrContainer, eMode_ContainerSplit }; + EMode eMode = eMode_LeafOrContainer; if (stNodeNamesCount == 1 && stChildCount > 1) { @@ -452,47 +452,41 @@ else eMode = eMode_ContainerSplit; } - else - eMode = eMode_LeafOrContainer; int iIndex = 0; for(const boost::property_tree::wiptree::value_type& rNode : rTree) { switch (eMode) { case eMode_LeafStringArrayEntries: - { - strNewPath = strCurrentPath + rNode.first.c_str(); - m_mic.insert(ConfigNode(++m_oidLastObjectID, strNewPath, iIndex++, rNode.second.get_value().c_str())); - break; - } + { + strNewPath = strCurrentPath + rNode.first.c_str(); + m_mic.insert(ConfigNode(++m_oidLastObjectID, strNewPath, iIndex++, rNode.second.get_value().c_str())); + break; + } case eMode_LeafOrContainer: - { - strNewPath = strCurrentPath + rNode.first.c_str(); - if (rNode.second.empty()) { - // get leaf info - m_mic.insert(ConfigNode(++m_oidLastObjectID, strNewPath, 0, rNode.second.get_value().c_str())); + strNewPath = strCurrentPath + rNode.first.c_str(); + if (rNode.second.empty()) + { + // get leaf info + m_mic.insert(ConfigNode(++m_oidLastObjectID, strNewPath, 0, rNode.second.get_value().c_str())); + } + else + { + // traverse through the container + ImportNode(strNewPath, rNode.second); + } + + break; } - else + case eMode_ContainerSplit: { - // traverse through the container + strNewPath = strCurrentPath + rNode.first.c_str() + _T("[") + boost::lexical_cast(iIndex++).c_str() + _T("]"); ImportNode(strNewPath, rNode.second); + break; } - - break; } - case eMode_ContainerSplit: - { - strNewPath = strCurrentPath + rNode.first.c_str() + _T("[") + boost::lexical_cast(iIndex++).c_str() + _T("]"); - ImportNode(strNewPath, rNode.second); - break; - } - case eMode_ContainerPassThrough: - { - break; - } - } } }