123456789101112131415161718 |
- #pragma once
- #include <string>
- #include <json.hpp>
- #include "../pub/LogOutput.h"
- template <typename ValueType>
- bool W_JsonContains(const nlohmann::json& json, std::string field, ValueType& value)
- {
- if (json.contains(field)) {
- json.at(field).get_to<ValueType>(value);
- return true;
- }
- else
- {
- LOG_INFO("common W_JsonContains Have No {}", field.c_str());
- return false;
- }
- }
|