changed Event json serialization to lohmann

This commit is contained in:
Johannes Wendel
2019-05-06 21:49:30 +02:00
parent 2e7a60c0de
commit 13815cc714

View File

@@ -6,7 +6,7 @@
*/ */
#include "input/Event.h" #include "input/Event.h"
#include <Poco/JSON/Object.h> #include "json/json.hpp"
#include "utility/config.h" #include "utility/config.h"
@@ -23,13 +23,13 @@ Event::Event(uint8_t address, int priority, std::string name) :
std::string Event::getJsonString() std::string Event::getJsonString()
{ {
Poco::JSON::Object json; nlohmann::json json;
json.set("name", this->name);
json.set("address", this->address);
json.set("priority", this->priority);
std::stringstream stringstream; json["name"] = this->name;
json.stringify(stringstream); json["address"] = this->address;
json["priority"] = this->priority;
json.dump();
} }
bool operator==(const Event& left, const Event& right) bool operator==(const Event& left, const Event& right)