changed Event json serialization to lohmann
This commit is contained in:
@@ -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["name"] = this->name;
|
||||||
json.set("priority", this->priority);
|
json["address"] = this->address;
|
||||||
|
json["priority"] = this->priority;
|
||||||
|
|
||||||
std::stringstream stringstream;
|
json.dump();
|
||||||
json.stringify(stringstream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Event& left, const Event& right)
|
bool operator==(const Event& left, const Event& right)
|
||||||
|
|||||||
Reference in New Issue
Block a user