Wespo  2.2
An unofficial tool to create a .po file for your wesnoth add-on
 All Classes Functions Variables
Public Member Functions | List of all members
WesPo Class Reference

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...
 

Detailed Description

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

See Also
WmlReader
LuaReader

Constructor & Destructor Documentation

WesPo::WesPo ( bool  fuzzyflag)

Constructor.

WesPo constructor

Parameters
fuzzyflagif true, all strings in skele.po will be marked as "fuzzy"

Member Function Documentation

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)

(WesPo init): register WML file list

This function is invoked by frmMain and it is a part of WesPo initialisation. It is needed to allow wespo to load WML file list

Parameters
srcWML file list
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.

Parameters
srcthe new textdomain found in #textdomain <X> in WML file
See Also
translate();
void WesPo::setDestFolder ( QString &  src)

(WesPo init): register add-on directory (dest directory for skele.po)

This function is invoked by frmMain and it is a part of WesPo initialisation. It is needed to allow wespo to know wesnoth add-on folder, and where to save skele.po

Parameters
srcthe complete path of wesnoth add-on folder
void WesPo::setLuaFiles ( QStringList &  src)

(WesPo init): register Lua file list

This function is invoked by frmMain and it is a part of WesPo initialisation. It is needed to allow wespo to load Lua file list

Parameters
srcLua file list
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


The documentation for this class was generated from the following files: