A Json Parser that supports strings in json sources! standard json doesn't support comments. This class strips the comments before passing it to qt the comments are replaced by spaces, this way the line-numbers and column numbers will stay the same.
More...
#include <jsonparser.h>
|
QByteArray | stripCommentsFromJson (const QByteArray &bytesIn) |
| reads all bytes from the io device, while removing comments and keeping the number of lines quick and dirty 'lexer' that replaces every comment by spaces (so the number of charactes keeps the same) More...
|
|
A Json Parser that supports strings in json sources! standard json doesn't support comments. This class strips the comments before passing it to qt the comments are replaced by spaces, this way the line-numbers and column numbers will stay the same.
◆ JsonParser()
edbee::JsonParser::JsonParser |
( |
| ) |
|
Constructs the jsonparser.
◆ ~JsonParser()
edbee::JsonParser::~JsonParser |
( |
| ) |
|
|
virtual |
◆ clearErrors()
void edbee::JsonParser::clearErrors |
( |
| ) |
|
Clears the error flags/variables.
◆ errorColumn()
int edbee::JsonParser::errorColumn |
( |
| ) |
const |
Returns the error column.
◆ errorLine()
int edbee::JsonParser::errorLine |
( |
| ) |
const |
returns the line number of the error
◆ errorMessage()
QString edbee::JsonParser::errorMessage |
( |
| ) |
const |
Returns the errormessage.
◆ fullErrorMessage()
QString edbee::JsonParser::fullErrorMessage |
( |
| ) |
const |
Returns the full eror message.
◆ parse() [1/3]
bool edbee::JsonParser::parse |
( |
const QString & |
fileName | ) |
|
loads the given keymap file returns true on success
- Parameters
-
filename | the filename to parse |
- Returns
- true if the file was parsed
◆ parse() [2/3]
bool edbee::JsonParser::parse |
( |
QIODevice * |
device | ) |
|
Parses the given QIODevice.
- Parameters
-
device | the device to parse the json data |
- Returns
- true if the file was successfully parsed
◆ parse() [3/3]
bool edbee::JsonParser::parse |
( |
const QByteArray & |
bytesIn | ) |
|
opens the given bytes as a json document
- Parameters
-
bytesIn | the bytes of the Json document |
- Returns
- true if the data was succeeful parsed
◆ result()
QVariant edbee::JsonParser::result |
( |
| ) |
|
Returns the result of the json parsing.
◆ stripCommentsFromJson()
QByteArray edbee::JsonParser::stripCommentsFromJson |
( |
const QByteArray & |
bytesIn | ) |
|
|
protected |
reads all bytes from the io device, while removing comments and keeping the number of lines quick and dirty 'lexer' that replaces every comment by spaces (so the number of charactes keeps the same)
The documentation for this class was generated from the following files: