34#ifndef _vpJsonParsing_h_
35#define _vpJsonParsing_h_
37#include <visp3/core/vpConfig.h>
39#ifdef VISP_HAVE_NLOHMANN_JSON
40#include <nlohmann/json.hpp>
54int flagsFromJSON(
const nlohmann::json &j)
59 for (
const auto &v : j) {
64 else if (j.is_number_integer()) {
79nlohmann::json flagsToJSON(
const int flags,
const std::vector<E> &options)
81 nlohmann::json j = nlohmann::json::array();
82 for (
const E option : options) {
91bool convertFromTypeAndBuildFrom(
const nlohmann::json &, T &)
96template<
typename T,
typename O,
typename... Os>
97bool convertFromTypeAndBuildFrom(
const nlohmann::json &j, T &t)
99 if (j[
"type"] == O::jsonTypeName) {
105 return convertFromTypeAndBuildFrom<T, Os...>(j, t);