![]() |
Wespo
2.2
An unofficial tool to create a .po file for your wesnoth add-on
|
WesPo class does the real work. It is where skele.po is created. More...
#include <wespo.h>
Public Member Functions | |
WesPo (bool fuzzyflag) | |
Constructor. More... | |
const QString | mainDir () |
return the complete path of the wesnoth add-on | |
const bool | translate () |
returs true if we are in the right textdomain | |
void | setCurrentDomain (QString &src) |
set a new textdomain scope when parsing a WML file More... | |
bool | track_textdomain () |
(WesPo init): scan _main.cfg and save add-on textdomain name More... | |
void | setDestFolder (QString &src) |
(WesPo init): register add-on directory (dest directory for skele.po) More... | |
void | setCfgFiles (QStringList &src) |
(WesPo init): register WML file list More... | |
void | setLuaFiles (QStringList &src) |
(WesPo init): register Lua file list More... | |
bool | doWork () |
Make skele.po: the "main" function (invoked by frmMain) | |
void | collectEntries (QList< WespoEntry > &wpdata) |
WesPo updates internal WespoEntry list with list obtained from WmlReader or LuaReader. More... | |
WesPo class does the real work. It is where skele.po is created.
WesPo class write the skele.po file, scanning files listed in cfgfiles (WML) and luafiles (LUA). WesPo uses WmlReader for parsing WML files and LuaReader for "parsing" Lua files. WesPo collects infos from WmlReader and LuaReader into Wespo Entries Finally, WesPo uses WespoEntry list to write skele.po and writes it
WesPo::WesPo | ( | bool | fuzzyflag | ) |
Constructor.
WesPo constructor
fuzzyflag | if true, all strings in skele.po will be marked as "fuzzy" |
void WesPo::collectEntries | ( | QList< WespoEntry > & | wpdata | ) |
WesPo updates internal WespoEntry list with list obtained from WmlReader or LuaReader.
This function is used by WmlReader and LuaReader when they finished to parse a file WmlReader and LuaReader send to wespo their WespoEntry list to WesPo. WesPo receives the list and check every entry contained. IF a new entry found (not an already existing string), then the new entry is simply added to WesPo list. Else (if string is not new) the related wespo Entry will be updated with the new infos.
void WesPo::setCfgFiles | ( | QStringList & | src | ) |
void WesPo::setCurrentDomain | ( | QString & | src | ) |
set a new textdomain scope when parsing a WML file
This function is useful when parsing a WML or Lua file. If the new textdomain is equal to the wespo internal textdomain (wesnoth-addon textdomain), than translate() will be setted to true. Else translate() will be setted to false.
src | the new textdomain found in #textdomain <X> in WML file |
void WesPo::setDestFolder | ( | QString & | src | ) |
void WesPo::setLuaFiles | ( | QStringList & | src | ) |
bool WesPo::track_textdomain | ( | ) |
(WesPo init): scan _main.cfg and save add-on textdomain name
This function is invoked by frmMain and it is a part of WesPo initialisation. It contains a minimal and rudimental wml_parser (state machine minimal parser) that analyze _main.cfg and checks textdomain. If textdomain found, the function save the value into the internal "textdomain" string