edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
jsonparser.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
8#include <QVariant>
9
10class QIODevice;
11
12namespace edbee {
13
18public:
19 JsonParser();
20 virtual ~JsonParser();
21
22 bool parse( const QString& fileName);
23 bool parse( QIODevice* device );
24 bool parse( const QByteArray& bytesIn );
25
26 QVariant result();
27
28 void clearErrors();
29
30 QString errorMessage() const;
31 int errorLine() const;
32 int errorColumn() const;
33
34 QString fullErrorMessage() const;
35
36protected:
37
38 QByteArray stripCommentsFromJson( const QByteArray& bytesIn );
39
40private:
41
42 QString errorMessage_;
43 int errorOffset_;
44 int errorLine_;
45 int errorColumn_;
46
47 QVariant result_;
48
49};
50
51} //edbee
JsonParser()
Constructs the jsonparser.
Definition jsonparser.cpp:18
QVariant result()
Returns the result of the json parsing.
Definition jsonparser.cpp:104
QString errorMessage() const
Returns the errormessage.
Definition jsonparser.cpp:119
int errorLine() const
returns the line number of the error
Definition jsonparser.cpp:126
QByteArray stripCommentsFromJson(const QByteArray &bytesIn)
reads all bytes from the io device, while removing comments and keeping the number of lines quick and...
Definition jsonparser.cpp:149
QString fullErrorMessage() const
Returns the full eror message.
Definition jsonparser.cpp:140
int errorColumn() const
Returns the error column.
Definition jsonparser.cpp:133
bool parse(const QString &fileName)
loads the given keymap file returns true on success
Definition jsonparser.cpp:37
void clearErrors()
Clears the error flags/variables.
Definition jsonparser.cpp:111
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20