Skip to content

Commit

Permalink
update to the latest oatpp API version.
Browse files Browse the repository at this point in the history
  • Loading branch information
lganzzzo committed Oct 25, 2021
1 parent d009d9c commit 4c55151
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/db/Database.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

#include "Database.hpp"
#include "oatpp/core/parser/Caret.hpp"
#include "oatpp/core/base/StrBuffer.hpp"

HueDevice Database::updateFromStateDto(v_int32 id, const oatpp::Object<HueDeviceStateDto> &hueDeviceStateDto) {
std::lock_guard<oatpp::concurrency::SpinLock> lock(m_lock);
Expand Down Expand Up @@ -65,7 +64,7 @@ HueDevice Database::serializeFromDto(const oatpp::Object<HueDeviceDto>& hueDevic
}
if(hueDeviceDto->uniqueid){
oatpp::parser::Caret caret(hueDeviceDto->uniqueid);
caret.setPosition(hueDeviceDto->uniqueid->getSize() - 4);
caret.setPosition(hueDeviceDto->uniqueid->size() - 4);
v_int32 id = caret.parseInt();
if (caret.hasError())
throw std::runtime_error("Malformed uniqueid: Unable to parse id integer");
Expand All @@ -76,7 +75,7 @@ HueDevice Database::serializeFromDto(const oatpp::Object<HueDeviceDto>& hueDevic

oatpp::Object<HueDeviceDto> Database::deserializeToDto(const HueDevice& hueDevice){
auto dto = HueDeviceDto::createShared();
size_t namehash = std::hash<std::string>{}(hueDevice.name->std_str());
size_t namehash = std::hash<std::string>{}(*hueDevice.name);
char idstr[32] = {0};
if (sizeof(size_t) == 8) {
// Mod with the largest prime under 2^32 to map the 64bit hash to 32bit
Expand Down

0 comments on commit 4c55151

Please sign in to comment.