File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -80,22 +80,31 @@ class JsonExporter
80
80
template <typename T>
81
81
Expected<T> fromJson (const nlohmann::json& source) const ;
82
82
83
- // / Register new JSON converters with addConverter<Foo>().
84
- // / You should have used first the macro BT_JSON_CONVERTER
83
+ /* *
84
+ * @brief Register new JSON converters with addConverter<Foo>().
85
+ * You should used first the macro BT_JSON_CONVERTER.
86
+ * The convertions from/to vector<T> are automatically registered.
87
+ */
85
88
template <typename T>
86
89
void addConverter ();
87
90
88
91
/* *
89
92
* @brief addConverter register a to_json function that converts a json to a type T.
93
+ * The convertion to std:vector<T> is automatically registered.
90
94
*
91
95
* @param to_json the function with signature void(const T&, nlohmann::json&)
92
96
* @param add_type if true, add a field called [__type] with the name ofthe type.
93
- * * /
97
+ */
94
98
template <typename T>
95
99
void addConverter (std::function<void (const T&, nlohmann::json&)> to_json,
96
100
bool add_type = true);
97
101
98
- // / Register custom from_json converter directly.
102
+ /* *
103
+ * @brief addConverter register a from_json function that converts a json to a type T.
104
+ * The convertions from std::vector<T> is automatically registered.
105
+ *
106
+ * @param from_json the function with signature void(const nlohmann::json&, T&)
107
+ */
99
108
template <typename T>
100
109
void addConverter (std::function<void (const nlohmann::json&, T&)> from_json);
101
110
You can’t perform that action at this time.
0 commit comments