2
Copyright (C) 2010 Kai Dombrowe <just89@gmx.de>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Lesser General Public License for more details.
14
You should have received a copy of the GNU Lesser General Public
15
License along with this library; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
#ifndef RESPONSEPARSER_H
20
#define RESPONSEPARSER_H
24
#include <joschycore/video.h>
25
#include <joschycore/plugin.h>
26
#include <joschycore/abstractresponseparser.h>
29
#include <QtCore/QByteArray>
32
class QXmlStreamReader;
36
class ResponseParser : public Joschy::AbstractResponseParser
42
explicit ResponseParser(const Type &type, const QString &id, const QVariantMap &data,
45
Joschy::Video getVideo() const;
46
QList<Joschy::Video> getVideos() const;
47
QString token() const;
48
QString login() const;
49
QByteArray image() const;
50
QHash<QString, QString> getCategorys() const;
52
void parseLogin(const QVariantMap &data);
53
void parseSearch(const QVariantMap &data);
54
void parseUpload(const QVariantMap &data);
55
void parseThumbnail(const QVariantMap &data);
56
void parseCategorys(const QVariantMap &data);
62
QList<Joschy::Video> m_videos;
64
QHash<QString, QString> m_categorys;
67
void parseXML(const QByteArray &response);
68
void readEntry(QXmlStreamReader *reader);
69
void readErrors(QXmlStreamReader *reader);
70
void parseAuth(const QByteArray &response);
71
void parseError(const QByteArray &response);
72
void parseErrorReply(const QString &reply);
73
void parseAdditionalErrorCodes(const int &code);
89
#endif // RESPONSEPARSER_H