MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getList

Method getList

src/Engine/Language.cpp:345–365  ·  view source on GitHub ↗

* Gets all the languages found in the * Data folder and returns their properties. * @param files List of language filenames. * @param names List of language human-readable names. */

Source from the content-addressed store, hash-verified

343 * @param names List of language human-readable names.
344 */
345void Language::getList(std::vector<std::string> &files, std::vector<std::wstring> &names)
346{
347 files = CrossPlatform::getFolderContents(CrossPlatform::getDataFolder("Language/"), "yml");
348 names.clear();
349
350 for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i)
351 {
352 *i = CrossPlatform::noExt(*i);
353 std::wstring name;
354 std::map<std::string, std::wstring>::iterator lang = _names.find(*i);
355 if (lang != _names.end())
356 {
357 name = lang->second;
358 }
359 else
360 {
361 name = Language::fsToWstr(*i);
362 }
363 names.push_back(name);
364 }
365}
366
367/**
368 * Loads a language file in Ruby-on-Rails YAML format.

Callers

nothing calls this directly

Calls 4

getFolderContentsFunction · 0.85
noExtFunction · 0.85
getDataFolderFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected