TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
json_scanner.h
Go to the documentation of this file.
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 Lesser General Public
7  * License version 2.1, as published by the Free Software Foundation.
8  *
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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser 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 _JSON_SCANNER
22 #define _JSON_SCANNER
23 
24 #include <QtCore/QIODevice>
25 #include <QtCore/QVariant>
26 #include <QtCore/QLocale>
27 
28 #define YYSTYPE QVariant
29 
30 // Only include FlexLexer.h if it hasn't been already included
31 #if ! defined(yyFlexLexerOnce)
32 #include "flexlexer.h"
33 #endif
34 
35 #include "parser_p.h"
36 
37 
38 
39 namespace yy {
40  class location;
41  int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver);
42 }
43 
44 class JSonScanner : public yyFlexLexer
45 {
46  public:
47  explicit JSonScanner(QIODevice* io);
48  ~JSonScanner();
49 
50  void allowSpecialNumbers(bool allow);
51 
52  int yylex(YYSTYPE* yylval, yy::location *yylloc);
53  int yylex();
54  int LexerInput(char* buf, int max_size);
55 
56  protected:
58  QIODevice* m_io;
59 
61  yy::location* m_yylloc;
63  QString m_currentString;
64  QLocale m_C_locale;
65 };
66 
67 #endif
int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate *driver)
#define YYSTYPE
Definition: json_scanner.h:28
void allowSpecialNumbers(bool allow)
voidpf void * buf
Definition: ioapi.h:136
QIODevice * m_io
Definition: json_scanner.h:58
bool m_allowSpecialNumbers
Definition: json_scanner.h:57
YYSTYPE * m_yylval
Definition: json_scanner.h:60
QLocale m_C_locale
Definition: json_scanner.h:64
Main class used to convert JSON data to QVariant objects private.
Definition: parser_p.h:41
yy::location * m_yylloc
Definition: json_scanner.h:61
QString m_currentString
Definition: json_scanner.h:63
JSonScanner(QIODevice *io)
int LexerInput(char *buf, int max_size)
bool m_criticalError
Definition: json_scanner.h:62