Wespo  2.2
An unofficial tool to create a .po file for your wesnoth add-on
 All Classes Functions Variables
wmlReader.h
1 /*
2  * wesPO - Unofficial wesnoth tool to create a basic .po for your own addon
3  *
4  * Made by Nobun
5  * www.mugenation.com
6  *
7  * Written with: Gcc-c++ (g++) / QT4
8  *
9  *------
10  *
11  * Copyright (C) 2009 Nobun
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program (GPL.txt). If not, see <http://www.gnu.org/licenses/>.
25  *
26  ******************************************************/
27 
28 #ifndef WML_READER_H
29 #define WML_READER_H
30 
31 #include <QPair>
32 #include "wespo.h"
33 #include "wmlNode.h"
34 #include "wespoCMD.h"
35 
37 
55 class WmlReader {
56 
57  public:
59 
64  WmlReader(WesPo *wp_x, QString &srcfile_); //wmlReader.cpp
66  bool loadWml(); //wmlReader.cpp
68  void checkNodes(); //wmlReader2.cpp
69 
70  private:
71  WesPo *wespo;
72  QString srcfile;
73  QString fileref;
74  //internal wmlNode list
75  QList <WmlNode *> lnode;
76  //list of unexecuted #wespo commands
77  QList <WespoCMD> wespoCmds;
78  //unordered data (WespoEntry list) paired with line num (will be reordered, sorting linenum ints)
79  QList < QPair <int, WespoEntry> > unordered_data;
80  //ordered data to send to wespo (will be obtained after reordering unordered data)
81  QList <WespoEntry> wpdata;
82 
83  //used in first step to localize translatable string in a tag when the tag is closed or a subtag is opened. Will be parsed and cleared every time a new tag is opened or every time the current tag is closed
84  QString maxstring;
85 
86  private:
88  bool parseMacrocall(WmlNode * current_node, int currentline, QString &xline); //MacroCall.cpp
90  void maxStringElab(WmlNode * my_current_node); //wmlReader.cpp
92  void node_inspect(WmlNode * node); //wmlReader2.cpp
94  void applyWespoCMD(WespoEntry &src); //wmlReader2.cpp
95 };
96 
97 
98 #endif
99 
struct: WML node (used by WmlReader)
Definition: wmlNode.h:58
WesPo class does the real work. It is where skele.po is created.
Definition: wespo.h:46
void checkNodes()
Invoked by WesPo. Starts the second step (convert nodes in WespoEntry list and send the list to WesPo...
Definition: wmlReader2.cpp:44
bool loadWml()
Invoked by WesPo. Starts the first step (load WML file in memory as WML nodes)
Definition: wmlReader.cpp:156
WmlReader(WesPo *wp_x, QString &srcfile_)
constructor
Definition: wmlReader.cpp:38
struct: a single wespo Entry (translatable string, srcinfos, comments)
Definition: wespoEntry.h:19
WmlReader parse a single .cfg (WML) file.
Definition: wmlReader.h:55