Salome HOME
Merge commit 'b1892f175d345f15c4b13b8e62c7d326bb9b4aab'
[modules/shaper.git] / src / Config / Config_DataModelReader.cpp
index a708d63ebcfb9f947ce9dfda28bc58e4c2893a03..ced55c97966af58ed18de31538e5e587a1388d22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-/*
- * Config_DataModelReader.cpp
- *
- *  Created on: Jul 21, 2015
- *      Author: vsv
- */
-
 #include "Config_DataModelReader.h"
 #include <Config_Keywords.h>
 #include "Config_Common.h"
 
 #include <Events_InfoMessage.h>
 
+#include <algorithm>
 
+// used only for GUI xml data reading
+// LCOV_EXCL_START
 Config_DataModelReader::Config_DataModelReader()
     : Config_XMLReader(DATAMODEL_FILE), isRootReading(true), myIsResultLink(false)
 {
@@ -52,10 +48,9 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode)
     std::string aIcon = getProperty(theNode, NODE_ICON);
     std::string aEmpty = getProperty(theNode, SHOW_EMPTY);
     std::string aFeatures = getProperty(theNode, FOLDER_FEATURES);
-    std::string::iterator aIt;
-    for (aIt = aEmpty.begin(); aIt != aEmpty.end(); aIt++) {
-      (*aIt) = toupper(*aIt);
-    }
+
+    std::transform(aEmpty.begin(), aEmpty.end(), aEmpty.begin(),
+                   [](char c) { return static_cast<char>(::toupper(c)); });
     bool aIsEmpty = (aEmpty == "FALSE")? false : true;
 
    if (isRootReading) {
@@ -78,10 +73,8 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode)
     isRootReading = false;
     mySubTypes = getProperty(theNode, GROUP_TYPE);
     std::string isResult = getProperty(theNode, LINK_ITEM);
-    std::string::iterator aIt;
-    for (aIt = isResult.begin(); aIt != isResult.end(); aIt++) {
-      (*aIt) = toupper(*aIt);
-    }
+    std::transform(isResult.begin(), isResult.end(), isResult.begin(),
+                   [](char c) { return static_cast<char>(::toupper(c)); });
     myIsResultLink = (isResult == "TRUE")? true : false;
   }
 }
@@ -138,4 +131,4 @@ std::string Config_DataModelReader::
 {
   return getFolderFeatures(theFolderName, myRootFolderNames, myRootFeaturesList);
 }
-
+// LCOV_EXCL_STOP