AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
MsgHandler.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "MsgTypes.h"
10 
11 #include <QJsonObject>
12 
13 namespace governikus
14 {
16 {
17  private:
18  const MsgType mType;
19  bool mVoid;
20 
21  MsgHandler();
22 
23  protected:
24  QJsonObject mJsonObject;
25 
26  MsgHandler(MsgType pType);
27  MsgHandler(MsgType pType, const char* pKey, const QString& pValue);
28  MsgHandler(MsgType pType, const char* pKey, const QLatin1String pValue);
29 
30  void setValue(const QLatin1String pKey, const QString& pValue);
31  void setValue(const char* pKey, const QString& pValue);
32  void setValue(const QLatin1String pKey, const QLatin1String pValue);
33  void setValue(const char* pKey, const QLatin1String pValue);
34 
35  void setVoid(bool pVoid = true);
36 
37  public:
38  static const MsgHandler Void;
39  static const MsgLevel DEFAULT_MSG_LEVEL;
40  static MsgType getStateMsgType(const QString& pState);
41 
42  QByteArray toJson() const;
43  QByteArray getOutput() const;
44  bool isVoid() const;
45  MsgType getType() const;
46 
47  void setRequest(const QJsonObject& pRequest);
48 };
49 
50 inline QDebug operator<<(QDebug pDbg, const MsgHandler& pMsg)
51 {
52  QDebugStateSaver saver(pDbg);
53  pDbg << pMsg.getType();
54  return pDbg.space();
55 }
56 
57 
58 } /* namespace governikus */
static const MsgLevel DEFAULT_MSG_LEVEL
Definition: MsgHandler.h:39
void setValue(const QLatin1String pKey, const QString &pValue)
Definition: MsgHandler.cpp:149
QJsonObject mJsonObject
Definition: MsgHandler.h:24
MsgType getType() const
Definition: MsgHandler.cpp:104
bool isVoid() const
Definition: MsgHandler.cpp:98
static const MsgHandler Void
Definition: MsgHandler.h:38
void setVoid(bool pVoid=true)
Definition: MsgHandler.cpp:143
QDebug operator<<(QDebug pDbg, const CardInfo &pCardInfo)
Definition: CardInfo.cpp:236
QByteArray getOutput() const
Definition: MsgHandler.cpp:87
void setRequest(const QJsonObject &pRequest)
Definition: MsgHandler.cpp:110
Definition: MsgHandler.h:15
static MsgType getStateMsgType(const QString &pState)
Definition: MsgHandler.cpp:22
QByteArray toJson() const
Definition: MsgHandler.cpp:80