#pragma once #include "nlohmann/json.hpp" #include "GeneralUtils.h" namespace nsMMF { // !!! Do Not change the order to support MMF use case using InputStatus = struct _InputStatus { char PtName[100]{}; bool On{ false }; // Assignment operator overload _InputStatus& operator=(const _InputStatus& rhs) { // strcpy_s(PtName, rhs.PtName); On = rhs.On; return *this; } }; } namespace nsMMF { using namespace nlohmann; using namespace nsUtils; void from_json(const json& j, InputStatus& x); void to_json(json& j, const InputStatus& x); inline void from_json(const json& j, InputStatus& x) { std::string name = j.at("PtName").get(); strcpy_s(x.PtName, name.c_str()); getValue(j, "On", x.On); } inline void to_json(json& j, const InputStatus& x) { j = nlohmann::json{ { "PtName", x.PtName }, { "On", x.On } }; } }