summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qjsonparseerror.h
blob: d8fc94448e6daf74bbf70868ba5025ac3e3953e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:header-decls-only

#ifndef QJSONPARSEERROR_H
#define QJSONPARSEERROR_H

#include <QtCore/qtconfigmacros.h>
#include <QtCore/qtcoreexports.h>
#include <QtCore/qtypes.h>

QT_BEGIN_NAMESPACE

class QString;

struct Q_CORE_EXPORT QJsonParseError
{
    enum ParseError {
        NoError = 0,
        UnterminatedObject,
        MissingNameSeparator,
        UnterminatedArray,
        MissingValueSeparator,
        IllegalValue,
        TerminationByNumber,
        IllegalNumber,
        IllegalEscapeSequence,
        IllegalUTF8String,
        UnterminatedString,
        MissingObject,
        DeepNesting,
        DocumentTooLarge,
        GarbageAtEnd
    };

    QString errorString() const;

    std::conditional_t<QT_VERSION_MAJOR < 7, int, qint64>
    offset = -1;
    ParseError error = NoError;
};

QT_END_NAMESPACE

#endif // QJSONPARSEERROR_H