Skip to content

Commit

Permalink
Fixed warnings on VS 2019 (eProsima#489)
Browse files Browse the repository at this point in the history
* Refs eProsima#5111. Fixed warning on vs2019.

* Tabs
  • Loading branch information
richiware authored and raquelalvarezbanos committed Apr 16, 2019
1 parent c776f0f commit a8691a4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/cpp/types/DynamicData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <fastrtps/log/Log.h>
#include <fastcdr/Cdr.h>

#include <locale>
#include <codecvt>

namespace eprosima {
namespace fastrtps {
namespace types {
Expand Down Expand Up @@ -1112,9 +1115,11 @@ void DynamicData::GetValue(std::string& sOutValue, MemberId id /*= MEMBER_ID_INV
{
wchar_t value(0);
GetChar16Value(value, id);
using convert_type = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_type, wchar_t> converter;
std::wstring temp = L"";
temp += value;
sOutValue = std::string(temp.begin(), temp.end());
sOutValue = converter.to_bytes(temp);
}
break;
case TK_BOOLEAN:
Expand All @@ -1138,9 +1143,11 @@ void DynamicData::GetValue(std::string& sOutValue, MemberId id /*= MEMBER_ID_INV
break;
case TK_STRING16:
{
using convert_type = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_type, wchar_t> converter;
std::wstring value;
GetWstringValue(value, id);
sOutValue = std::string(value.begin(), value.end());
sOutValue = converter.to_bytes(value);
}
break;
case TK_ENUM:
Expand Down

0 comments on commit a8691a4

Please sign in to comment.