From 51d14cefa1508c48d1022b5f3b94ef89a499847c Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sat, 19 Oct 2024 10:40:40 -0700 Subject: [PATCH] Fix further build issues --- util.cpp | 15 +++++++++++++-- util.hpp | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/util.cpp b/util.cpp index 3be20a1..8050f40 100644 --- a/util.cpp +++ b/util.cpp @@ -197,9 +197,20 @@ Property make_property(PropertyType type, std::string name, PropertyId id, std:: return output; } Property make_property(PropertyType type, std::string name, std::string path, std::optional hint) { - return make_property(type, name, PropertyId::BackendSpecific, path, hint) + return make_property(type, name, PropertyId::BackendSpecific, path, hint); } Property make_property(PropertyType type, std::string name, PropertyId id, std::optional hint) { - return make_property(type, name, id, {}, hint) + return make_property(type, name, id, {}, hint); } +PropertyHint make_hint(std::optional min = {}, std::optional max = {}) { + PropertyHint output; + PropertyHintRange &range = *output.mutable_range(); + if (min.has_value()) { + range.set_min(min.value()); + } + if (max.has_value()) { + range.set_max(max.value()); + } + return output; +} diff --git a/util.hpp b/util.hpp index f4f9b22..52ab854 100644 --- a/util.hpp +++ b/util.hpp @@ -555,6 +555,7 @@ inline google::protobuf::Any value_to_any(std::string value) { output.set_value(value); return value_to_any(output); } +PropertyHint make_hint(double min, double max); Property make_property(PropertyType type, std::string name, PropertyId id, std::optional hint); Property make_property(PropertyType type, std::string name, std::string path, std::optional hint = {}); Property make_property(PropertyType type, std::string name, PropertyId id = PropertyId::BackendSpecific, std::optional path = {}, std::optional hint = {});