一、QT5 Json简介

QT4中使用第三方库QJson解析JSON文件。

QT5新增加了处理JSON的类,类均以QJson开头,包含在QtCore模块中。QT5新增加六个相关类:

QJsonArray

封装 JSON 数组

QJsonDocument

读写 JSON 文档

QJsonObject

封装 JSON 对象

QJsonObject::iterator

用于遍历QJsonObject的STL风格的非const遍历器

QJsonParseError

报告 JSON 处理过程中出现的错误

QJsonValue

封装 JSON 值

二、QJsonDocument

1、QJsonDocument简介

QJsonDocument提供了读写Json文档的方法。

QJsonDocument是一个包含了完整JSON文档的类,支持以UTF-8编码的文本和QT自身的二进制格式来读写JSON文档。

JSON文档可以使用QJsonDocument::fromJson()将基于JSON文档的文本形式转换为QJsonDocument对象,toJSON()可以将QJsonDocument转换回文本形式

解析文档的有效性可以使用 !isNull() 进行查询。

使用isArray()和isObject()可以分别查询一个文档是否包含了一个数组或一个object。使用array()或object()可以将包含在文档中的数组或object提取出来。

使用fromBinaryData()或fromRawData()也可以从一个二进制形式创建一个QJsonDocument对象。

2、QJsonDocument成员函数

[static] QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation = Validate)

Validation决定数据是否在使用前检查数据有效性。

[static] QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR)

将json解析为UTF-8的JSON文档

[static] QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation = Validate)

使用data数据的前size字节创建一个QJsonDocument对象

[static] QJsonDocument QJsonDocument::fromVariant(const QVariant &variant)

根据variant创建QJsonDocument对象

bool QJsonDocument::isArray() const

bool QJsonDocument::isEmpty() const

bool QJsonDocument::isNull() const

bool QJsonDocument::isObject() const

QJsonObject QJsonDocument::object() const

返回文档中包含的QJsonObject对象

const char *QJsonDocument::rawData(int *size) const

返回size大小的二进制数据

void QJsonDocument::setArray(const QJsonArray &array)

设置array作为文档中的主对象

void QJsonDocument::setObject(const QJsonObject &object)

设置object作为文档中的主对象

QByteArray QJsonDocument::toBinaryData() const

返回文档的二进制格式数据

QByteArray QJsonDocument::toJson(JsonFormat format = Indented) const

将QJsonDocument转换为UTF-8编码的format格式的JSON文档

QVariant QJsonDocument::toVariant() const

返回JSON文档的QVariant格式

3、QJsonDocument对象的构建

A、QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR)

fromJson()可以由QByteArray对象构造一个QJsonDocument对象

QJsonObject json;
json.insert("name", QString("Qt"));
json.insert("version", 5);
json.insert("windows", true);
QJsonDocument document;
document.setObject(json);
QByteArray byte_array = document.toJson(QJsonDocument::Compact);
QJsonParseError json_error;
QJsonDocument parse_doucment = QJsonDocument::fromJson(byte_array, &json_error);

B、QJsonDocument fromVariant(const QVariant &variant)

QVariantList people;
QVariantMap bob;
bob.insert("Name", "Bob");
bob.insert("Phonenumber", 123);
QVariantMap alice;
alice.insert("Name", "Alice");
alice.insert("Phonenumber", 321);
people << bob << alice;
QJsonDocument jsonDocument = QJsonDocument::fromVariant(people);
if (!jsonDocument.isNull()) 
{
    qDebug() << jsonDocument.toJson();
}

C、QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate)

D、QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate)

三、QJsonArray

1、QJsonArray简介

QJsonArray封装了JSON数组。

JSON数组是值的链表,可以插入和删除QJsonValue。

QJsonArray与QVariantList可以相互转换。QJsonArray可以用size(), insert(), removeAt()进行操作,还可以用标准C++的迭代器模式来迭代其内容。

QJsonArray是一个隐式共享的类,只要没有被改变,可以和创建QJsonArray的document共享数据。

通过QJsonDocument可以将一个QJsonArray转换成或转换自一个文本形式的JSON。

2、QJsonArray成员函数

QJsonArray::QJsonArray(std::initializer_list<QJsonValue> args)

构建一个QJsonArray

QJsonArray::QJsonArray(const QJsonArray &other)

void QJsonArray::append(const QJsonValue &value)

在QJsonArray尾部插入value

QJsonValue QJsonArray::at(int i) const

返回QJsonArray中索引为i的QJsonValue值

iterator QJsonArray::begin()

const_iterator QJsonArray::begin() const

返回指向数组第一个元素的STL风格迭代器

const_iterator QJsonArray::constBegin() const

返回指向数组第一个元素的const STL风格迭代器

const_iterator QJsonArray::constEnd() const

返回指向数组最后一个元素后的位置的const STL风格迭代器

bool QJsonArray::contains(const QJsonValue &value) const

如果数组中包含value,返回true

int QJsonArray::count() const

返回数组的大小

bool QJsonArray::empty() const

如果数组为空,返回true

const_iterator QJsonArray::end() const

返回指向数组最后一个元素后的位置的STL风格迭代器

iterator QJsonArray::erase(iterator it)

删除迭代器it指向的元素,返回指向下一个元素的迭代器

QJsonValue QJsonArray::first() const

返回数组中的第一个值

[static] QJsonArray QJsonArray::fromStringList(const QStringList &list)

将一个字符串链表list转换为QJsonArray

[static] QJsonArray QJsonArray::fromVariantList(const QVariantList &list)

将链表list转换为QJsonArray

四、QJsonObject

1、QJsonObject简介

QJsonObject类用于封装JSON对象。JSON对象是包含键值对的链表,其中键是唯一的字符串,其值由QJsonValue代表。

QJsonObject可以与QVariantMap相互转换,可以用size()来获得键值对的数目,insert()、remove()分别用来插入和删除pair。可以用标准C++的迭代器模式(iterator pattern)来迭代其内容。

QJsonObject是一个隐式共享的类,只要没有被改变过,QJsonObject会和创建它的document共享数据。

可以通过QJsonDocument将QJsonObject和文本格式相互转换。

2、QJsonObject成员函数

QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args)

使用键值对链表构建QJsonObject对象

QJsonObject::QJsonObject(const QJsonObject &other)

iterator QJsonObject::begin()

const_iterator QJsonObject::begin() const

返回指向JSON对象的第一个元素的STL风格的迭代器

const_iterator QJsonObject::constBegin() const

返回指向JSON对象的第一个元素的const STL风格的迭代器

const_iterator QJsonObject::constEnd() const

返回SJON对象的最后一个元素后的位置的const STL风格的迭代器

const_iterator QJsonObject::constFind(const QString &key) const

返回一个指向键值对中键为key的元素的const迭代器

bool QJsonObject::contains(const QString &key) const

如果JSON对象中包含键key,返回true

int QJsonObject::size() const

int QJsonObject::count() const

返回JSON对象中键值对的数量

bool QJsonObject::empty() const

bool QJsonObject::isEmpty() const

如果JSON对象为空,返回true

iterator QJsonObject::find(const QString &key)

const_iterator QJsonObject::find(const QString &key) const

返回指向JSON对象中键为key的键值对的迭代器

[static] QJsonObject QJsonObject::fromVariantHash(const QVariantHash &hash)

将hash转换为JSON对象

[static] QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map)

将map转换为JSON对象

iterator QJsonObject::insert(const QString &key, const QJsonValue &value)

插入键为key,值为value的键值对,返回插入键值对的迭代器

QStringList QJsonObject::keys() const

返回JSON对象的所有键的链表

void QJsonObject::remove(const QString &key)

删除JSON对象中的key

QJsonValue QJsonObject::take(const QString &key)

删除JSON对象中的键key,返回key对应的QJsonValue

QVariantHash QJsonObject::toVariantHash() const

将JSON对象转换为QVariantHash

QVariantMap QJsonObject::toVariantMap() const

将JSON对象转换为QVariantMap

QJsonValue QJsonObject::value(const QString &key) const

返回key对应的QJsonValue值

五、QJsonParseError

1、QJsonParseError简介

QJsonParseError类用于在JSON解析中报告错误。

常量

描述

QJsonParseError::NoError

0

未发生错误

QJsonParseError::UnterminatedObject

1

对象不正确地终止以右花括号结束

QJsonParseError::MissingNameSeparator

2

分隔不同项的逗号丢失

QJsonParseError::UnterminatedArray

3

数组不正确地终止以右中括号结束

QJsonParseError::MissingValueSeparator

4

对象中分割 key/value 的冒号丢失

QJsonParseError::IllegalValue

5

值是非法的

QJsonParseError::TerminationByNumber

6

在解析数字时,输入流结束

QJsonParseError::IllegalNumber

7

数字格式不正确

QJsonParseError::IllegalEscapeSequence

8

在输入时,发生一个非法转义序列

QJsonParseError::IllegalUTF8String

9

在输入时,发生一个非法 UTF8 序列

QJsonParseError::UnterminatedString

10

字符串不是以引号结束

QJsonParseError::MissingObject

11

一个对象是预期的,但是不能被发现

QJsonParseError::DeepNesting

12

对解析器来说,JSON 文档嵌套太深

QJsonParseError::DocumentTooLarge

13

对解析器来说,JSON 文档太大

QJsonParseError::GarbageAtEnd

14

解析的文档在末尾处包含额外的乱码

2、QJsonParseError成员函数

QString QJsonParseError::errorString() const

返回JSON解析错误时报告的错误信息

五、QJsonValue

1、QJsonValue简介

QJsonValue类封装了JSON中的值。JSON中的值有6种基本类型:

bool QJsonValue::Bool
double QJsonValue::Double
string QJsonValue::String
array QJsonValue::Array
object QJsonValue::Object
null QJsonValue::Null
Undefined QJsonValue::Undefined

value可以是以上任何一种数据类型。另外,QJsonValue有一个特殊的flag来表示未定义类型。可以用isUndefined()来查询。

可以用type()或isBool(),、isString()等来查询value的类型。类似的,可以用toBool()、toString()等将一个value转换成存储在该value内部的类型。

2、QJsonValue成员函数

[static] QJsonValue QJsonValue::fromVariant(const QVariant &variant)

将variant转换为QJsonValue

bool QJsonValue::isArray() const

如果QJsonValue包含一个数组,返回true

bool QJsonValue::isBool() const

如果QJsonValue包含一个bool,返回true

bool QJsonValue::isDouble() const

如果QJsonValue包含一个double,返回true

bool QJsonValue::isNull() const

如果QJsonValue包含一个Null,返回true

bool QJsonValue::isObject() const

如果QJsonValue包含一个object,返回true

bool QJsonValue::isString() const

如果QJsonValue包含一个string,返回true

bool QJsonValue::isUndefined() const

如果QJsonValue包含一个undefined,返回true

QJsonArray QJsonValue::toArray(const QJsonArray &defaultValue) const

将QJsonValue转换为QJsonArray并返回,如果类型不是array,返回默认值defaultValue

QJsonArray QJsonValue::toArray() const

将QJsonValue转换为QJsonArray并返回

bool QJsonValue::toBool(bool defaultValue = false) const

将QJsonValue转换为bool并返回

double QJsonValue::toDouble(double defaultValue = 0) const

将QJsonValue转换为double并返回

int QJsonValue::toInt(int defaultValue = 0) const

将QJsonValue转换为int并返回

QJsonObject QJsonValue::toObject(const QJsonObject &defaultValue) const
QJsonObject QJsonValue::toObject() const

将QJsonValue转换为QJsonObject并返回

QString QJsonValue::toString(const QString &defaultValue = QString()) const

将QJsonValue转换为QString并返回

Type QJsonValue::type() const

返回QJsonValue的类型

六、JSON解析编程

1、JSON解析流程

JSON解析的流程如下:

A、将对应的字符串生成QJsonDocument对象

B、判断QJsonDocument对象是QJsonObject还是QJsonArray

C、如果是QJsonObject类型,获取一个QJsonObject对象,然后根据QJsonObject的API函数进行解析

D、如果是QJsonArray类型,获取一个QJsonArray对象,然后根据QJsonArray的API函数进行解析

E、根据获取的QJsonObject或QJsonArray取得QJsonValue类型的数据

F、迭代分解数据获取各个值

JSON解析流程实例:

#include <QCoreApplication>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonParseError>
#include <QJsonValue>
#include <QString>
#include <QStringList>
#include <QDebug>
 
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
 
    QString json("{\"name\":\"scorpio\", \"year\":2016, \"array\":[30, \"hello\", true]}");
    QJsonParseError jsonerror;
    QJsonDocument doc = QJsonDocument::fromJson(json.toLatin1(), &jsonerror);
    if (!doc.isNull() && jsonerror.error == QJsonParseError::NoError)
    {
        if(doc.isObject())
        {
            QJsonObject object = doc.object();
            QStringList list = object.keys();
            for(int i = 0; i < list.count(); i++)
            {
                qDebug() << list.at(i);
            }
            QJsonObject::iterator it = object.begin();
            while(it != object.end())
            {
                switch(it.value().type())
                {
                case QJsonValue::String:
                {
                    qDebug() << "Type is string";
                    QJsonArray sub = it.value().toArray();
                    qDebug() << it.key() << "=" << it.value().toString();
                    break;
                }
                case QJsonValue::Array:
                {
                    qDebug() << "Type is Array";
                    qDebug() << it.key() << "=" << it.value().toArray();
                    QJsonArray sub = it.value().toArray();
                    qDebug() << "index 1:" << sub.at(0).toDouble();
                    qDebug() << "index 2:" << sub.at(1).toString();
                    qDebug() << "index 3:" << sub.at(2).toBool();
                    break;
                }
                case QJsonValue::Bool:
                {
                    qDebug() << "Type is Bool";
                    qDebug() << it.key() << "=" << it.value().toBool();
                    break;
                }
                case QJsonValue::Double:
                {
                    qDebug() << "Type is Double";
                    qDebug() << it.key() << "=" << it.value().toDouble();
                    break;
                }
                case QJsonValue::Object:
                {
                    qDebug() << "Type is Object";
                    qDebug() << it.key() << "=" << it.value().toObject();
                    break;
                }
                case QJsonValue::Null:
                {
                    qDebug() << "Type is Null";
                    qDebug() << it.key() << "= NULL" ;
                    break;
                }
                case QJsonValue::Undefined:
                {
                    qDebug() << "Type is Undefined";
                    break;
                }
                }
                it++;
            }
        }
    }
 
    return a.exec();
}

2、QJsonObject

JSON对象:

{
"Cross Platform": true,
"From": 2016,
"Name": "Qt"
}

A、构建JSON对象

// 构建 JSON 对象
QJsonObject json;
json.insert("Name", "Qt");
json.insert("From", 2016);
json.insert("Cross Platform", true);

B、构建JSON文档

// 构建 JSON 文档
QJsonDocument document;
document.setObject(json);
QByteArray byteArray = document.toJson();
QString strJson(byteArray);

C、解析JSON

 QJsonParseError jsonError;
    QJsonDocument doucment = QJsonDocument::fromJson(byteArray, &jsonError);  
    if (!doucment.isNull() && (jsonError.error == QJsonParseError::NoError))
    { 
        if (doucment.isObject())
        { 
            QJsonObject object = doucment.object();  
            if (object.contains("Name"))
            {  // 包含指定的 key
                QJsonValue value = object.value("Name"); 
                if (value.isString())
                {  // 判断 value 是否为字符串
                    QString strName = value.toString(); 
                    qDebug() << "Name : " << strName;
                }
            }
            if (object.contains("From"))
            {
                QJsonValue value = object.value("From");
                if (value.isDouble())
                {
                    int nFrom = value.toVariant().toInt();
                    qDebug() << "From : " << nFrom;
                }
            }
            if (object.contains("Cross Platform"))
            {
                QJsonValue value = object.value("Cross Platform");
                if (value.isBool())
                {
                    bool bCrossPlatform = value.toBool();
                    qDebug() << "CrossPlatform : " << bCrossPlatform;
                }
            }
        }
    }

3、QJsonArray

JSON数组:

[
"Qt",
5.7,
true
]

A、构建JSON数组

// 构建 JSON 数组
QJsonArray json;
json.append("Qt");
json.append(5.7);
json.append(true);

B、构建JSON文档

// 构建 JSON 文档
QJsonDocument document;
document.setArray(json);
QByteArray byteArray = document.toJson(QJsonDocument::Compact);
QString strJson(byteArray);

C、解析JSON

 QJsonParseError jsonError;
    QJsonDocument doucment = QJsonDocument::fromJson(byteArray, &jsonError); 
    if (!doucment.isNull() && (jsonError.error == QJsonParseError::NoError)) 
    { 
        if (doucment.isArray()) 
        { 
            QJsonArray array = doucment.array();  
            int nSize = array.size();  
            for (int i = 0; i < nSize; ++i) 
            {  // 遍历数组
                QJsonValue value = array.at(i);
                if (value.type() == QJsonValue::String) 
                {
                    QString strName = value.toString();
                    qDebug() << strName;
                }
                if (value.type() == QJsonValue::Double) 
                {
                    double dVersion = value.toDouble();
                    qDebug() << dVersion;
                }
                if (value.type() == QJsonValue::Bool) 
                {
                    bool bCrossPlatform  = value.toBool();
                    qDebug() << bCrossPlatform;
                }
            }
        }
    }

4、复杂JSON

{

    "Company": "Digia",

    "From": 1991,

    "Name": "Qt",

    "Page": {

        "Developers": "https://www.qt.io/developers/",

        "Download": "https://www.qt.io/download/",

        "Home": "https://www.qt.io/"},

    "Version": [

        4.8,

        5.2,

        5.7]

}

 

   // 构建 Json 数组 - Version
    QJsonArray versionArray;
    versionArray.append(4.8);
    versionArray.append(5.2);
    versionArray.append(5.7);
 
    // 构建 Json 对象 - Page
    QJsonObject pageObject;
    pageObject.insert("Home", "https://www.qt.io/");
    pageObject.insert("Download", "https://www.qt.io/download/");
    pageObject.insert("Developers", "https://www.qt.io/developers/");
 
    // 构建 Json 对象
    QJsonObject json;
    json.insert("Name", "Qt");
    json.insert("Company", "Digia");
    json.insert("From", 1991);
    json.insert("Version", QJsonValue(versionArray));
    json.insert("Page", QJsonValue(pageObject));
 
    // 构建 Json 文档
    QJsonDocument document;
    document.setObject(json);
    QByteArray byteArray = document.toJson(QJsonDocument::Compact);
    QString strJson(byteArray);
        //解析JSON
    QJsonParseError jsonError;
    QJsonDocument doucment = QJsonDocument::fromJson(byteArray, &jsonError);
    if (!doucment.isNull() && (jsonError.error == QJsonParseError::NoError))
    {
        if (doucment.isObject())
        {
            QJsonObject object = doucment.object();
            if (object.contains("Name"))
            {
                QJsonValue value = object.value("Name");
                if (value.isString())
                {
                    QString strName = value.toString();
                    qDebug() << "Name : " << strName;
                }
            }
            if (object.contains("Company"))
            {
                QJsonValue value = object.value("Company");
                if (value.isString())
                {
                    QString strCompany = value.toString();
                    qDebug() << "Company : " << strCompany;
                }
            }
            if (object.contains("From"))
            {
                QJsonValue value = object.value("From");
                if (value.isDouble())
                {
                    int nFrom = value.toVariant().toInt();
                    qDebug() << "From : " << nFrom;
                }
            }
            if (object.contains("Version"))
            {
                QJsonValue value = object.value("Version");
                if (value.isArray())
                {
                    QJsonArray array = value.toArray();
                    int nSize = array.size();
                    for (int i = 0; i < nSize; ++i)
                    {
                        QJsonValue value = array.at(i);
                        if (value.isDouble())
                        {
                            double dVersion = value.toDouble();
                            qDebug() << "Version : " << dVersion;
                        }
                    }
                }
            }
            if (object.contains("Page"))
            {
                QJsonValue value = object.value("Page");
                if (value.isObject())
                {
                    QJsonObject obj = value.toObject();
                    if (obj.contains("Home"))
                    {
                        QJsonValue value = obj.value("Home");
                        if (value.isString())
                        {
                            QString strHome = value.toString();
                            qDebug() << "Home : " << strHome;
                        }
                    }
                    if (obj.contains("Download"))
                    {
                        QJsonValue value = obj.value("Download");
                        if (value.isString())
                        {
                            QString strDownload = value.toString();
                            qDebug() << "Download : " << strDownload;
                        }
                    }
                    if (obj.contains("Developers"))
                    {
                        QJsonValue value = obj.value("Developers");
                        if (value.isString())
                        {
                            QString strDevelopers = value.toString();
                            qDebug() << "Developers : " << strDevelopers;
                        }
                    }
                }
            }
        }
    }
#include <QCoreApplication>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QDebug>
#include <QString>
#include <QJsonParseError>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QJsonArray jsonArray;
    jsonArray.insert(0,"linux");
    jsonArray.insert(1,"python");
    jsonArray.insert(2,"java");

    QJsonObject json;
    json.insert("name",QString("QT"));
    json.insert("version",5);
    json.insert("windows",true);
    json.insert("language",jsonArray);

    QJsonDocument document;
    document.setObject(json);
    QByteArray bytearray = document.toJson(QJsonDocument::Compact);

    QString jsonStr(bytearray);
    qDebug() << bytearray;
    qDebug() << jsonStr;

    QJsonParseError jsonError;
    QJsonDocument paserDoc = QJsonDocument::fromJson(bytearray,&jsonError);
    if (jsonError.error == QJsonParseError::NoError) {
        QJsonObject paserObj = paserDoc.object();
        if (paserObj.contains("name")) {
            QJsonValue nameValue = paserObj.take("name");
            if (nameValue.isString()) {
                qDebug() << "name: " << nameValue.toString();
            }
        }
        if (paserObj.contains("version")) {
            QJsonValue version = paserObj["version"];
            if (version.isDouble())
                qDebug() << "version: " << version.toInt();
        }
        if (paserObj.contains("language")) {
            QJsonValue langValue = paserObj.take("language");
            if (langValue.isArray()) {
                QJsonArray array = langValue.toArray();
                for(int i = 0; i < array.size(); ++i) {
                   QJsonValue tmp = array.at(i);
                   if (tmp.isString())
                        qDebug() << tmp.toString();
                }
            }
        }
    }

    return a.exec();
}
"{\"language\":[\"linux\",\"python\",\"java\"],\"name\":\"QT\",\"version\":5,\"w
indows\":true}"
"{\"language\":[\"linux\",\"python\",\"java\"],\"name\":\"QT\",\"version\":5,\"w
indows\":true}"
name:  "QT"
version:  5
"linux"
"python"
"java"

GitHub 加速计划 / js / json
19
5
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:4 个月前 )
f06604fc * :page_facing_up: bump the copyright years Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :page_facing_up: bump the copyright years Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :page_facing_up: bump the copyright years Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com> 25 天前
d23291ba * add a ci step for Json_Diagnostic_Positions Signed-off-by: Harinath Nampally <harinath922@gmail.com> * Update ci.cmake to address review comments Signed-off-by: Harinath Nampally <harinath922@gmail.com> * address review comment Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix typo in the comment Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix typos in ci.cmake Signed-off-by: Harinath Nampally <harinath922@gmail.com> * invoke the new ci step from ubuntu.yml Signed-off-by: Harinath Nampally <harinath922@gmail.com> * issue4561 - use diagnostic positions for exceptions Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix ci_test_documentation check Signed-off-by: Harinath Nampally <harinath922@gmail.com> * address review comments Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix ci check failures for unit-diagnostic-postions.cpp Signed-off-by: Harinath Nampally <harinath922@gmail.com> * improvements based on review comments Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix const correctness string Signed-off-by: Harinath Nampally <harinath922@gmail.com> * further refinements based on reviews Signed-off-by: Harinath Nampally <harinath922@gmail.com> * add one more test case for full coverage Signed-off-by: Harinath Nampally <harinath922@gmail.com> * ci check fix - add const Signed-off-by: Harinath Nampally <harinath922@gmail.com> * add unit tests for json_diagnostic_postions only Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix ci_test_diagnostics Signed-off-by: Harinath Nampally <harinath922@gmail.com> * fix ci_test_build_documentation check Signed-off-by: Harinath Nampally <harinath922@gmail.com> --------- Signed-off-by: Harinath Nampally <harinath922@gmail.com> 25 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐