Files
logos-cpp-sdk/cpp/logos_json_convert.h
T
Iuri Matias 4e20614cda add universal qt-free provider interface (#67)
add universal qt-free provider interface

address review
2026-05-22 17:44:07 -04:00

29 lines
724 B
C++

#ifndef LOGOS_JSON_CONVERT_H
#define LOGOS_JSON_CONVERT_H
#include <QVariant>
#include <QVariantList>
#include <QJsonArray>
#include <nlohmann/json.hpp>
#include <string>
#include <vector>
struct LogosMethodMetadata {
std::string name;
std::string signature;
std::string returnType;
bool isInvokable = true;
nlohmann::json parameters = nlohmann::json::array();
};
namespace logos {
nlohmann::json qvariantToNlohmann(const QVariant& v);
QVariant nlohmannToQVariant(const nlohmann::json& j);
QVariantList nlohmannArgsToQVariantList(const nlohmann::json& args);
QJsonArray methodsToJsonArray(const std::vector<LogosMethodMetadata>& methods);
} // namespace logos
#endif // LOGOS_JSON_CONVERT_H