/
farado
/
farado-binara
Обзор
Документация
Войти
/
farado
/
farado-binara
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
src/common/helpers/context_helper.cpp
29 строк
535 B
Ostapenko Alexey
[common] Отказ от boost::ptree в пользу библиотеки nlohmann.
07 мар 2024, 17:11
07 мар 2024, 17:11
1e93742
Код
Авторство
О чём код?
#include "context_helper.h" namespace Common { ContextValue contextFromJson(const Common::Json& json) { return ContextValue(crow::json::load(json.dump())); } ContextValue contextFromElement(const Elements::ElementPtr element) { if (element) return contextFromJson(element->toJson()); return {}; } std::vector<ContextValue> ContextList::data() const { return m_data; } ContextList& ContextList::operator<<(const ContextValue& value) { m_data.push_back(value); return *this; } } // namespace Common