~ubuntu-branches/ubuntu/vivid/pyqt5/vivid-201503180912

« back to all changes in this revision

Viewing changes to sip/QtCore/qjsondocument.sip

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2014-09-13 14:13:57 UTC
  • mto: (1.4.1) (3.3.5 sid)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: package-import@ubuntu.com-20140913141357-9apgipnzsu9msmii
Tags: upstream-5.3.2+dfsg
ImportĀ upstreamĀ versionĀ 5.3.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// qjsondocument.sip generated by MetaSIP on Fri Sep 12 22:59:00 2014
 
2
//
 
3
// This file is part of the QtCore Python extension module.
 
4
//
 
5
// Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com>
 
6
// 
 
7
// This file is part of PyQt5.
 
8
// 
 
9
// This file may be used under the terms of the GNU General Public License
 
10
// version 3.0 as published by the Free Software Foundation and appearing in
 
11
// the file LICENSE included in the packaging of this file.  Please review the
 
12
// following information to ensure the GNU General Public License version 3.0
 
13
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 
14
// 
 
15
// If you do not wish to use this file under the terms of the GPL version 3.0
 
16
// then you may purchase a commercial license.  For more information contact
 
17
// info@riverbankcomputing.com.
 
18
// 
 
19
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
20
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
21
 
 
22
 
 
23
struct QJsonParseError
 
24
{
 
25
%TypeHeaderCode
 
26
#include <qjsondocument.h>
 
27
%End
 
28
 
 
29
    enum ParseError
 
30
    {
 
31
        NoError,
 
32
        UnterminatedObject,
 
33
        MissingNameSeparator,
 
34
        UnterminatedArray,
 
35
        MissingValueSeparator,
 
36
        IllegalValue,
 
37
        TerminationByNumber,
 
38
        IllegalNumber,
 
39
        IllegalEscapeSequence,
 
40
        IllegalUTF8String,
 
41
        UnterminatedString,
 
42
        MissingObject,
 
43
        DeepNesting,
 
44
        DocumentTooLarge,
 
45
    };
 
46
 
 
47
    QString errorString() const;
 
48
    int offset;
 
49
    QJsonParseError::ParseError error;
 
50
};
 
51
 
 
52
class QJsonDocument
 
53
{
 
54
%TypeHeaderCode
 
55
#include <qjsondocument.h>
 
56
%End
 
57
 
 
58
public:
 
59
    QJsonDocument();
 
60
    explicit QJsonDocument(const QJsonObject &object);
 
61
    explicit QJsonDocument(const QJsonArray &array);
 
62
    QJsonDocument(const QJsonDocument &other);
 
63
    ~QJsonDocument();
 
64
 
 
65
    enum DataValidation
 
66
    {
 
67
        Validate,
 
68
        BypassValidation,
 
69
    };
 
70
 
 
71
    static QJsonDocument fromRawData(const char *data /Encoding="None"/, int size, QJsonDocument::DataValidation validation = QJsonDocument::Validate);
 
72
    const char *rawData(int *size /Out/) const /Encoding="None"/;
 
73
    static QJsonDocument fromBinaryData(const QByteArray &data, QJsonDocument::DataValidation validation = QJsonDocument::Validate);
 
74
    QByteArray toBinaryData() const;
 
75
    static QJsonDocument fromVariant(const QVariant &variant);
 
76
    QVariant toVariant() const;
 
77
 
 
78
    enum JsonFormat
 
79
    {
 
80
        Indented,
 
81
        Compact,
 
82
    };
 
83
 
 
84
    static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
 
85
    QByteArray toJson() const;
 
86
    QByteArray toJson(QJsonDocument::JsonFormat format) const;
 
87
    bool isEmpty() const;
 
88
    bool isArray() const;
 
89
    bool isObject() const;
 
90
    QJsonObject object() const;
 
91
    QJsonArray array() const;
 
92
    void setObject(const QJsonObject &object);
 
93
    void setArray(const QJsonArray &array);
 
94
    bool operator==(const QJsonDocument &other) const;
 
95
    bool operator!=(const QJsonDocument &other) const;
 
96
    bool isNull() const;
 
97
};