![]() |
Wespo
2.2
An unofficial tool to create a .po file for your wesnoth add-on
|
WmlReader parse a single .cfg (WML) file. More...
#include <wmlReader.h>
Public Member Functions | |
WmlReader (WesPo *wp_x, QString &srcfile_) | |
constructor More... | |
bool | loadWml () |
Invoked by WesPo. Starts the first step (load WML file in memory as WML nodes) | |
void | checkNodes () |
Invoked by WesPo. Starts the second step (convert nodes in WespoEntry list and send the list to WesPo) | |
WmlReader parse a single .cfg (WML) file.
WmlReader loads a WML file in memory and translate collected datas in WespoEntry list. The process is a bit complex and it is divided in two Steps. 1) In the first step WmlReader loads all data contained in a WML file into WML Nodes (function loadWML(), invoked by WesPo). A wmlNode is a data structure that contains a pointer of parent wmlNode (upnode), an unique tagname (equals to [tag]: ) and a list of wml Lines. A Wml line is an WML line of code (when an important param of current tag is important and must be saved in memory; isstring = false) A Wml line is also a single translatable string (isstring = true). In that case a single Wml line could be also a multiline string 1B) the code of the first step is splitted in two files. wmlReader.cpp -> code for the entire step 1 process (the most complex step) MacroReader.cpp -> code for parsing a single macro Call when the current line contains a Macro Call. 2) In the second step WmlReader (function checkNodes()) converts internal wmlNodes into a WespoEntry list. The code of the second step is contained in wmlReader2.cpp The process is structured in this way:
WmlReader::WmlReader | ( | WesPo * | wp_x, |
QString & | srcfile_ | ||
) |