Files
log_analysis_web/cpp-server/controllers/include/controllers/implementation.h
T

18 lines
755 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <string>
#include <json/json.h>
/// @brief Парсинг строки в json
/// @param[in] data Строка
/// @throws std::runtime_error В случае ошибки парсинга (например, некорректный формат)
/// @returns json
json ParseJson(const char* data);
/// @brief Проверка наличия необходимых ключей
/// @param[in] json Объект, который надо проверить
/// @param[in] fields Необходимые ключи
/// @throws std::runtime_error В случае отсутствия хотя бы одного ключа
void CheckForRequiredFields(const json& json, std::initializer_list<std::string_view> fields);