24 #include "openPMD/config.hpp" 26 #include <nlohmann/json.hpp> 42 enum class SupportedLanguages
50 nlohmann::json config;
51 SupportedLanguages originallySpecifiedAs{SupportedLanguages::JSON};
79 inline nlohmann::json &
json()
81 return *m_positionInOriginal;
84 template <
typename Key>
93 nlohmann::json
const &getShadow()
const;
101 nlohmann::json invertShadow()
const;
110 void declareFullyRead();
112 SupportedLanguages originallySpecifiedAs{SupportedLanguages::JSON};
121 std::shared_ptr<nlohmann::json> m_originalJSON;
131 std::shared_ptr<nlohmann::json> m_shadow;
137 nlohmann::json *m_positionInOriginal;
143 nlohmann::json *m_positionInShadow;
147 nlohmann::json &result, nlohmann::json
const &shadow)
const;
150 std::shared_ptr<nlohmann::json> originalJSON,
151 std::shared_ptr<nlohmann::json> shadow,
152 nlohmann::json *positionInOriginal,
153 nlohmann::json *positionInShadow,
154 SupportedLanguages originallySpecifiedAs,
158 template <
typename Key>
161 nlohmann::json *newPositionInOriginal =
162 &m_positionInOriginal->operator[](key);
165 static nlohmann::json nullvalue;
166 nlohmann::json *newPositionInShadow = &nullvalue;
167 if (m_trace && m_positionInOriginal->is_object())
169 newPositionInShadow = &m_positionInShadow->operator[](key);
171 bool traceFurther = newPositionInOriginal->is_object();
175 newPositionInOriginal,
177 originallySpecifiedAs,
181 nlohmann::json tomlToJson(toml::value
const &val);
182 toml::value jsonToToml(nlohmann::json
const &val);
193 ParsedConfig parseOptions(std::string
const &options,
bool considerFiles);
201 parseOptions(std::string
const &options, MPI_Comm comm,
bool considerFiles);
214 nlohmann::json &lowerCase(nlohmann::json &);
223 std::optional<std::string> asStringDynamic(nlohmann::json
const &);
228 std::optional<std::string> asLowerCaseStringDynamic(nlohmann::json
const &);
234 extern std::vector<std::string> backendKeys;
242 void warnGlobalUnusedOptions(
TracingJSON const &config);
249 merge(nlohmann::json &defaultVal, nlohmann::json
const &overwrite);
Extend nlohmann::json with tracing of which keys have been accessed by operator[]().
Definition: JSON_internal.hpp:67
nlohmann::json & json()
Access the underlying JSON value.
Definition: JSON_internal.hpp:79
Public definitions of openPMD-api.
Definition: JSON_internal.hpp:48