Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
// We ned to manually unwrap numbers
template <typename T>
wm::result<T> get(nlohmann::json const &j) {
// We ned to manually unwrap numbers
template <typename T>
wm::result<T> get(nlohmann::json const &j) {
T r;
std::istringstream s(j.get<std::string>());
s >> r;
T r;
std::istringstream s(j.get<std::string>());
s >> r;
namespace wm {
surface_id_to_layer::surface_id_to_layer(nlohmann::json const &j) {
namespace wm {
surface_id_to_layer::surface_id_to_layer(nlohmann::json const &j) {
if (j["type"] == "range") {
this->id_min = get<int>(j["first_surface_id"]);
this->id_max = get<int>(j["last_surface_id"]);
if (j["type"] == "range") {
this->id_min = get<int>(j["first_surface_id"]);
this->id_max = get<int>(j["last_surface_id"]);