QJson project page QJson home page

parser.h
1 /* This file is part of QJson
2  *
3  * Copyright (C) 2008 Flavio Castelli <flavio.castelli@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef QJSON_PARSER_H
22 #define QJSON_PARSER_H
23 
24 #include "qjson_export.h"
25 
26 class QIODevice;
27 class QVariant;
28 
29 namespace QJson {
30 
31  class ParserPrivate;
32 
36  class QJSON_EXPORT Parser
37  {
38  public:
39  Parser();
40  ~Parser();
41 
48  QVariant parse(QIODevice* io, bool* ok = 0);
49 
58  QVariant parse(const QByteArray& jsonData, bool* ok = 0);
59 
65  QString errorString() const;
66 
72  int errorLine() const;
73 
74  private:
75  Q_DISABLE_COPY(Parser)
76  ParserPrivate* const d;
77  };
78 }
79 
80 #endif // QJSON_PARSER_H

SourceForge Logo hosts this site. Send comments to:
QJson Developers