4 #include <QXmlStreamReader>
8 #include <QCoreApplication>
13 namespace LightApp_Msg
19 Message(const QString& src, const QString& trl):source(src),translation(trl){};
20 QString GetSource() const { return source ;}
21 QString GetTranslation() const { return translation ;}
22 void Set_Source(const QString& str) { source = str; }
23 void Set_Translation(const QString& str) { translation = str; }
32 Context(const QString& name):Context_name(name){};
33 QString GetContext_name(){return Context_name;}
34 void AddMsg(Message& msg) {Message_list.append(msg);}
35 void AddMsg(const QString& src, const QString& trl) {Message_list.append(Message(src,trl));}
36 Message* GetMessagebySrc(const QString&);
37 QList<Message>& GetMessageList(){return Message_list;}
38 QString ExportContext();
41 QList<Message> Message_list;
44 class LightApp_Msg_handling
47 LightApp_Msg_handling(std::unique_ptr<QList<Context>> Context_list):
48 Context_list(std::move(Context_list)){};
49 void read(QIODevice *device);
51 Context* GetContextbyName(const QString &name);
52 bool HaveContext(const QString &name);
54 QXmlStreamReader xmlReader;
55 std::unique_ptr<QList<Context>> Context_list;
60 void readSrc(Message& msg);
61 void readTranslation(Message& msg);