libQuotient
A Qt library for building matrix clients
tag.h
Go to the documentation of this file.
1 // THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
2 
3 #pragma once
4 
5 #include <Quotient/converters.h>
6 
7 namespace Quotient {
8 
9 struct QUOTIENT_API Tag {
10  //! A number in a range `[0,1]` describing a relative
11  //! position of the room under the given tag.
12  std::optional<float> order{};
13 };
14 
15 template <>
16 struct JsonObjectConverter<Tag> {
17  static void dumpTo(QJsonObject& jo, const Tag& pod)
18  {
19  addParam<IfNotEmpty>(jo, "order"_L1, pod.order);
20  }
21  static void fillFrom(const QJsonObject& jo, Tag& pod)
22  {
23  fillFromJson(jo.value("order"_L1), pod.order);
24  }
25 };
26 
27 } // namespace Quotient