#ifndef TMCAGLWM_JSON_HELPER_HPP #define TMCAGLWM_JSON_HELPER_HPP #include "result.hpp" #include "wayland.hpp" #include struct json_object; json_object *to_json(genivi::screen const *s); json_object *to_json(genivi::controller::props_map const &s); json_object *to_json(std::vector const &v); // We ned to manually unwrap numbers template wm::result get(nlohmann::json const &j) { // DB(j); T r; std::istringstream s(j.get()); s >> r; return !s.eof() || s.fail() ? wm::Err("Could not read int") : wm::Ok(r); } #endif // TMCAGLWM_JSON_HELPER_HPP