34#ifndef VP_JSON_PARSING_H
35#define VP_JSON_PARSING_H
37#include <visp3/core/vpConfig.h>
39#ifdef VISP_HAVE_NLOHMANN_JSON
40#include VISP_NLOHMANN_JSON(json.hpp)
55int flagsFromJSON(
const nlohmann::json &j)
60 for (
const auto &v : j) {
65 else if (
j.is_number_integer()) {
80nlohmann::json flagsToJSON(
const unsigned int flags,
const std::vector<E> &options)
82 nlohmann::json
j = nlohmann::json::array();
83 for (
const E option : options) {
92bool convertFromTypeAndBuildFrom(
const nlohmann::json &, T &)
97template<
typename T,
typename O,
typename... Os>
98bool convertFromTypeAndBuildFrom(
const nlohmann::json &j, T &t)
100 if (j[
"type"] == O::jsonTypeName) {
107 return convertFromTypeAndBuildFrom<T, Os...>(
j,
t);