]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Events/Events_InfoMessage.cpp
Salome HOME
updated copyright message
[modules/shaper.git] / src / Events / Events_InfoMessage.cpp
index ba26c145f734935d98e8bb31886a6e237f341eed..54088a90f7224774098dcdc7aa0933f931eca4ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 
 #include "Events_InfoMessage.h"
+#include <Locale_Convert.h>
 #include <sstream>
 
-// To support old types of GCC (less than 5.0), check the wide-string conversion is working
-#if (__cplusplus >= 201103L || _MSVC_LANG >= 201103L)  && \
-    (__cplusplus >= 201402L || !defined(__GLIBCXX__)   || \
-    (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE > 4))
-#define HAVE_WORKING_WIDESTRING 1
-#else
-#define HAVE_WORKING_WIDESTRING 0
-#endif
-
-#if HAVE_WORKING_WIDESTRING
-#include <codecvt>
-#endif
-
 void Events_InfoMessage::addParameter(double theParam)
 {
   std::stringstream aStream;
@@ -55,16 +43,6 @@ void Events_InfoMessage::send()
 
 Events_InfoMessage& Events_InfoMessage::arg(const std::wstring& theParam)
 {
-#if HAVE_WORKING_WIDESTRING
-  static std::wstring_convert<std::codecvt_utf8<wchar_t> > aConvertor;
-  addParameter(aConvertor.to_bytes(theParam));
-#else
-  char* aBuf = new char[2 * (theParam.size() + 1)];
-  size_t aNbChars = std::wcstombs(aBuf, theParam.c_str(), theParam.size());
-  if (aNbChars != (size_t)-1)
-    aBuf[aNbChars] = '\0';
-  addParameter(aBuf);
-  delete[] aBuf;
-#endif
+  addParameter(Locale::Convert::toString(theParam));
   return *this;
 }