initial commit
This commit is contained in:
commit
9d20827c46
2469 changed files with 470994 additions and 0 deletions
40
third-party/JsonQt/lib/VariantToJson.h
vendored
Normal file
40
third-party/JsonQt/lib/VariantToJson.h
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef _JSONQT_VARIANT_TO_JSON_H
|
||||
#define _JSONQT_VARIANT_TO_JSON_H
|
||||
|
||||
#include "JsonQtExport.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QVariant>
|
||||
|
||||
namespace JsonQt
|
||||
{
|
||||
/** Class for converting QVariants into JSON structures.
|
||||
*
|
||||
* The following variant types are supported:
|
||||
* - QVariant::Bool
|
||||
* - QVariant::String
|
||||
* - QVariant::Double
|
||||
* - QVariant::Int
|
||||
* - QVariant::LongLong
|
||||
* - QVariant::UInt
|
||||
* - QVariant::ULongLong
|
||||
* - QVariant::Invalid
|
||||
* - QVariant::List // JSON array
|
||||
* - QVariant::Map // JSON object
|
||||
*
|
||||
* @author Fred Emmott <mail@fredemmott.co.uk>
|
||||
*/
|
||||
class JSONQT_EXPORT VariantToJson
|
||||
{
|
||||
public:
|
||||
/// Parse a QVariant into JSON.
|
||||
static QString parse(const QVariantMap& data);
|
||||
private:
|
||||
static QString parseElement(const QVariant& element);
|
||||
static QString parseList(const QVariantList& list);
|
||||
static QString parseStringList(const QStringList& list);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in a new issue