|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
#include <jsonc_document.h>
Public Member Functions | |
| bool | parse (const QByteArray &jsonc) |
| const QJsonDocument & | document () const |
| const QString & | errorString () const |
| int | errorLine () const |
| int | errorColumn () const |
| int | lineOf (const QString &name, const QString &child=QString()) const |
A JSON document read from JSONC text (JSON with line and block comments).
Comments are blanked by json_strip_jsonc_comments(), which keeps the offset of every other byte, so error positions and lines refer to the original text. QJsonDocument carries no positions; lineOf() finds a member by searching the text.
|
inline |
The parsed document; null after a failed parse().
|
inline |
1-based column (in bytes) of the syntax error, or 0 when unknown.
|
inline |
1-based line of the syntax error, or 0 when unknown.
|
inline |
Why the last parse() failed, translated; empty after success.
| int JsoncDocument::lineOf | ( | const QString & | name, |
| const QString & | child = QString() ) const |
1-based line of the member "name":, or 0 when it is absent. With child, the line of the first "child": after it, which finds a key inside an object in the usual one-member-per-line layout.
| bool JsoncDocument::parse | ( | const QByteArray & | jsonc | ) |
Parses jsonc.