Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
generator.cpp File Reference
#include "generator.h"
#include "cbordevice.h"
#include "outputrevision.h"
#include "utils.h"
#include <QtCore/qmetatype.h>
#include <QtCore/qjsondocument.h>
#include <QtCore/qjsonobject.h>
#include <QtCore/qjsonvalue.h>
#include <QtCore/qjsonarray.h>
#include <QtCore/qplugin.h>
#include <QtCore/qstringview.h>
#include <math.h>
#include <stdio.h>
#include <private/qmetaobject_p.h>
#include <private/qplugin_p.h>
#include "cborencoder.c"
+ Include dependency graph for generator.cpp:

Go to the source code of this file.

Macros

#define RETURN_METATYPENAME_STRING(MetaTypeName, MetaTypeId, RealType)    case QMetaType::MetaTypeName: return #MetaTypeName;
 
#define STREAM_SMART_POINTER(SMART_POINTER)   << #SMART_POINTER
 
#define STREAM_1ARG_TEMPLATE(TEMPLATENAME)   << #TEMPLATENAME
 
#define CBOR_ENCODER_WRITER_CONTROL   1
 
#define CBOR_ENCODER_WRITE_FUNCTION   CborDevice::callback
 

Functions

uint nameToBuiltinType (const QByteArray &name)
 
bool isBuiltinType (const QByteArray &type)
 
static const char * metaTypeEnumValueString (int type)
 
static qsizetype lengthOfEscapeSequence (const QByteArray &s, qsizetype i)
 
static void printStringWithIndentation (FILE *out, const QByteArray &s)
 
static int aggregateParameterCount (const QList< FunctionDef > &list)
 
static bool qualifiedNameEquals (const QByteArray &qualifiedName, const QByteArray &name)
 
static QByteArray generateQualifiedClassNameIdentifier (const QByteArray &identifier)
 
static CborError jsonValueToCbor (CborEncoder *parent, const QJsonValue &v)
 
static CborError jsonObjectToCbor (CborEncoder *parent, const QJsonObject &o)
 
static CborError jsonArrayToCbor (CborEncoder *parent, const QJsonArray &a)
 

Macro Definition Documentation

◆ CBOR_ENCODER_WRITE_FUNCTION

#define CBOR_ENCODER_WRITE_FUNCTION   CborDevice::callback

Definition at line 1615 of file generator.cpp.

◆ CBOR_ENCODER_WRITER_CONTROL

#define CBOR_ENCODER_WRITER_CONTROL   1

Definition at line 1614 of file generator.cpp.

◆ RETURN_METATYPENAME_STRING

#define RETURN_METATYPENAME_STRING (   MetaTypeName,
  MetaTypeId,
  RealType 
)     case QMetaType::MetaTypeName: return #MetaTypeName;

◆ STREAM_1ARG_TEMPLATE

#define STREAM_1ARG_TEMPLATE (   TEMPLATENAME)    << #TEMPLATENAME

◆ STREAM_SMART_POINTER

#define STREAM_SMART_POINTER (   SMART_POINTER)    << #SMART_POINTER

Function Documentation

◆ aggregateParameterCount()

static int aggregateParameterCount ( const QList< FunctionDef > &  list)
static

Definition at line 136 of file generator.cpp.

References list, and sum.

◆ generateQualifiedClassNameIdentifier()

static QByteArray generateQualifiedClassNameIdentifier ( const QByteArray identifier)
static

Definition at line 203 of file generator.cpp.

References QByteArray::replace().

Referenced by Generator::generateCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isBuiltinType()

bool isBuiltinType ( const QByteArray type)

Definition at line 40 of file generator.cpp.

References qMetaTypeTypeInternal(), QMetaType::UnknownType, and QMetaType::User.

Referenced by Generator::generateCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jsonArrayToCbor()

static CborError jsonArrayToCbor ( CborEncoder *  parent,
const QJsonArray a 
)
static

Definition at line 1497 of file generator.cpp.

References jsonValueToCbor(), and parent.

Referenced by jsonValueToCbor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jsonObjectToCbor()

static CborError jsonObjectToCbor ( CborEncoder *  parent,
const QJsonObject o 
)
static

Definition at line 1482 of file generator.cpp.

References it, jsonValueToCbor(), map, o, parent, and QMap< Key, T >::size().

Referenced by jsonValueToCbor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jsonValueToCbor()

static CborError jsonValueToCbor ( CborEncoder *  parent,
const QJsonValue v 
)
static

Definition at line 1506 of file generator.cpp.

References QJsonValue::Array, QJsonValue::Bool, d, QJsonValue::Double, jsonArrayToCbor(), jsonObjectToCbor(), QJsonValue::Null, QJsonValue::Object, parent, Q_INT64_C, QJsonValue::String, and QJsonValue::Undefined.

Referenced by jsonArrayToCbor(), and jsonObjectToCbor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lengthOfEscapeSequence()

static qsizetype lengthOfEscapeSequence ( const QByteArray s,
qsizetype  i 
)
inlinestatic

Definition at line 76 of file generator.cpp.

References ch, i, QtMiscUtils::isHexDigit(), QtMiscUtils::isOctalDigit(), and qMin().

Referenced by printStringWithIndentation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ metaTypeEnumValueString()

static const char * metaTypeEnumValueString ( int  type)
static

Definition at line 48 of file generator.cpp.

References QT_FOR_EACH_STATIC_TYPE, and RETURN_METATYPENAME_STRING.

◆ nameToBuiltinType()

uint nameToBuiltinType ( const QByteArray name)

Definition at line 28 of file generator.cpp.

References qMetaTypeTypeInternal(), QMetaType::UnknownType, and QMetaType::User.

+ Here is the call graph for this function:

◆ printStringWithIndentation()

static void printStringWithIndentation ( FILE *  out,
const QByteArray s 
)
static

Definition at line 101 of file generator.cpp.

References lengthOfEscapeSequence(), out, qBound(), and qMin().

Referenced by Generator::generateCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qualifiedNameEquals()

static bool qualifiedNameEquals ( const QByteArray qualifiedName,
const QByteArray name 
)
static

Definition at line 193 of file generator.cpp.

References QByteArray::indexOf(), QByteArray::mid(), and qualifiedNameEquals().

Referenced by Generator::generateCode(), and qualifiedNameEquals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: