/usr/include/qjson/parser.h is in libqjson-dev 0.8.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | /* This file is part of QJson
*
* Copyright (C) 2008 Flavio Castelli <flavio.castelli@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef QJSON_PARSER_H
#define QJSON_PARSER_H
#include "qjson_export.h"
class QIODevice;
class QVariant;
/**
* Namespace used by QJson
*/
namespace QJson {
class ParserPrivate;
/**
* @brief Main class used to convert JSON data to QVariant objects
*/
class QJSON_EXPORT Parser
{
public:
Parser();
~Parser();
/**
* Read JSON string from the I/O Device and converts it to a QVariant object
* @param io Input output device
* @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
* @returns a QVariant object generated from the JSON string
*/
QVariant parse(QIODevice* io, bool* ok = 0);
/**
* This is a method provided for convenience.
* @param jsonData data containing the JSON object representation
* @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
* @returns a QVariant object generated from the JSON string
* @sa errorString
* @sa errorLine
*/
QVariant parse(const QByteArray& jsonData, bool* ok = 0);
/**
* This method returns the error message
* @returns a QString object containing the error message of the last parse operation
* @sa errorLine
*/
QString errorString() const;
/**
* This method returns line number where the error occurred
* @returns the line number where the error occurred
* @sa errorString
*/
int errorLine() const;
/**
* Sets whether special numbers (Infinity, -Infinity, NaN) are allowed as an extension to
* the standard
* @param allowSpecialNumbers new value of whether special numbers are allowed
* @sa specialNumbersAllowed
*/
void allowSpecialNumbers(bool allowSpecialNumbers);
/**
* @returns whether special numbers (Infinity, -Infinity, NaN) are allowed
* @sa allowSpecialNumbers
*/
bool specialNumbersAllowed() const;
private:
Q_DISABLE_COPY(Parser)
ParserPrivate* const d;
};
}
#endif // QJSON_PARSER_H
|