#include "rktutils.h"

#include <QJsonDocument>
#include <QJsonObject>
#include <QMetaType>

QString mkEventJson(const EventContainer &kv)
{
    QJsonObject obj;

    QList<QString> keys = kv.keys();
    int i, N;
    for(i = 0, N = keys.length(); i < N; i++) {
        const QString  &key = keys[i];
        const QVariant &v = kv[key];
        obj[key] = v.toJsonValue();
    }

    QJsonDocument doc(obj);
    return QString::fromUtf8(doc.toJson(QJsonDocument::JsonFormat::Compact));
}

QHash<QString, QVariant> mkEvent()
{
    QHash<QString, QVariant> h;
    return h;
}

int EventContainer::evt_count = 0;
qint64 EventContainer::ms_start = -1;
