]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMBlackBox.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMBlackBox.cpp
index c92c6777725e724c3729b679b9cfebeb8eb4c5d2..73220cc924cc93d7bc416bf848e25384c0670073 100644 (file)
@@ -132,7 +132,7 @@ bool modelCDMBlackBox::SetAuthors(const std::string& authors, std::string*& resu
   std::vector<std::string> words;
   CDMUtilities::splitter::split(words, authors, "/\\\"\n", CDMUtilities::splitter::no_empties);
   std::string authorsReal = words[0];
-  for (int i = 1; i < words.size(); i++)
+  for (int i = 1; i < (int)(words.size()); i++)
     {
       authorsReal += "," + words[i];
     }
@@ -172,7 +172,12 @@ bool modelCDMBlackBox::SetAuthors(const std::string& authors, std::string*& resu
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
+  
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");
@@ -192,7 +197,7 @@ bool modelCDMBlackBox::SetCategories(
   std::vector<std::string> words;
   CDMUtilities::splitter::split(words, categories, "\"\\/", CDMUtilities::splitter::no_empties);
   std::string catsReal = words[0];
-  for (int i = 1; i < words.size(); i++)
+  for (int i = 1; i < (int)(words.size()); i++)
     {
       catsReal += "," + words[i];
     }
@@ -232,7 +237,12 @@ bool modelCDMBlackBox::SetCategories(
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
+  
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");
@@ -251,7 +261,7 @@ bool modelCDMBlackBox::SetDescription(
   std::vector<std::string> words;
   CDMUtilities::splitter::split(words, description, "\"\n\\/", CDMUtilities::splitter::no_empties);
   std::string descReal = words[0];
-  for (int i = 1; i < words.size(); i++)
+  for (int i = 1; i < (int)(words.size()); i++)
     {
       descReal += "-" + words[i];
     }
@@ -291,7 +301,11 @@ bool modelCDMBlackBox::SetDescription(
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");