Crossfire Server, Trunk  R20513
MessageFile.h
Go to the documentation of this file.
1 #ifndef _MESSAGEFILE_H
2 #define _MESSAGEFILE_H
3 
4 #include <QObject>
5 #include <QStringList>
6 
8 
9 class MessageRule : public QObject
10 {
11  Q_OBJECT
12 
13  public:
14  MessageRule();
15  MessageRule(const MessageRule& original);
16  virtual ~MessageRule();
17 
18  const QString& comment() const;
19  void setComment(const QString& comment);
20  const QStringList& match() const;
21  QStringList& match();
22  void setMatch(const QStringList& match);
23  const QList<QStringList>& preconditions() const;
24  void setPreconditions(const QList<QStringList>& preconditions);
25  const QList<QStringList>& postconditions() const;
26  void setPostconditions(const QList<QStringList>& postconditions);
27  const QStringList& messages() const;
28  void setMessages(const QStringList& messages);
29  const QStringList& include() const;
30  void setInclude(const QStringList& include);
31  const QList<QStringList>& replies() const;
32  void setReplies(const QList<QStringList>& replies);
33 
34  bool isModified() const;
35  void setModified(bool modified = true);
36 
37  private:
39  QString myComment;
40  QStringList myMatch;
41  QList<QStringList> myPreconditions;
42  QList<QStringList> myPostconditions;
43  QStringList myMessages;
44  QStringList myInclude;
45  QList<QStringList> myReplies;
46 };
47 
48 class MessageFile : public QObject
49 {
50  Q_OBJECT
51 
52  public:
53  MessageFile(const QString& path);
54  virtual ~MessageFile();
55 
56  bool parseFile();
57 
58  const QString& path() const;
59  void setPath(const QString& path);
60 
61  const QString& location() const;
62  void setLocation(const QString& location);
63 
64  QList<MessageRule*>& rules();
65  QList<CREMapInformation*>& maps();
66 
67  void save();
68 
69  bool isModified() const;
70  void setModified(bool modified = true);
71 
72  private:
74  QString myPath;
75  QString myLocation;
76  QList<MessageRule*> myRules;
77  QList<CREMapInformation*> myMaps;
78 };
79 
80 #endif /* _MESSAGEFILE_H */
const QList< QStringList > & postconditions() const
Definition: MessageFile.cpp:66
const QList< QStringList > & preconditions() const
Definition: MessageFile.cpp:56
QStringList myInclude
Definition: MessageFile.h:44
const QString & comment() const
Definition: MessageFile.cpp:31
void setPostconditions(const QList< QStringList > &postconditions)
Definition: MessageFile.cpp:71
void setModified(bool modified=true)
virtual ~MessageRule()
Definition: MessageFile.cpp:27
QString myComment
Definition: MessageFile.h:39
QStringList myMatch
Definition: MessageFile.h:40
void setPreconditions(const QList< QStringList > &preconditions)
Definition: MessageFile.cpp:61
QList< QStringList > myPostconditions
Definition: MessageFile.h:42
bool myIsModified
Definition: MessageFile.h:73
void setMatch(const QStringList &match)
Definition: MessageFile.cpp:51
QString myLocation
Definition: MessageFile.h:75
void setReplies(const QList< QStringList > &replies)
QList< MessageRule * > myRules
Definition: MessageFile.h:76
void setInclude(const QStringList &include)
Definition: MessageFile.cpp:91
void setComment(const QString &comment)
Definition: MessageFile.cpp:36
QString myPath
Definition: MessageFile.h:74
QList< CREMapInformation * > myMaps
Definition: MessageFile.h:77
const QStringList & match() const
Definition: MessageFile.cpp:41
bool myIsModified
Definition: MessageFile.h:38
QList< QStringList > myPreconditions
Definition: MessageFile.h:41
void setMessages(const QStringList &messages)
Definition: MessageFile.cpp:81
QStringList myMessages
Definition: MessageFile.h:43
const QStringList & include() const
Definition: MessageFile.cpp:86
QList< QStringList > myReplies
Definition: MessageFile.h:45
bool isModified() const
const QStringList & messages() const
Definition: MessageFile.cpp:76
const QList< QStringList > & replies() const
Definition: MessageFile.cpp:96