Skip to content

Commit

Permalink
Try to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sgallou committed Jan 8, 2025
1 parent 2cb5318 commit 774b034
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions sources/plugins/StreamDeck/linux/DeviceManagerHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ std::vector<std::string> CDeviceManagerHelper::splitStringToVectorOfString(const
return split(words, wordToSplit, boost::is_any_of(separator), boost::token_compress_on);
}

uint16_t CDeviceManagerHelper::decimalToHex(std::string decimalValue)
uint16_t CDeviceManagerHelper::decimalToHex(const std::string& decimalValue)
{
boost::cnv::cstream converter;
return boost::convert<uint16_t>(decimalValue, converter(std::showbase)(std::uppercase)(std::dec), 0);
uint16_t result;
std::stringstream ss;

// Configure le stream pour lire un nombre décimal
ss << std::dec << decimalValue;

// Convertir la chaîne en uint16_t
if (!(ss >> result))
{
throw std::invalid_argument("Invalid decimal value: " + decimalValue);
}

return result;
}

uint16_t CDeviceManagerHelper::stringToUnsignedShort(std::string& value)
Expand Down

0 comments on commit 774b034

Please sign in to comment.