mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Integrated legacy parser into API.
This commit is contained in:
+19
-4
@@ -29,6 +29,7 @@
|
||||
#include "../backend/generators.h"
|
||||
#include "../backend/error.h"
|
||||
#include "../backend/streams.h"
|
||||
#include "../backend/legacy-parser.h"
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
@@ -238,11 +239,25 @@ BOSS_API unsigned int boss_load_lists (boss_db db, const char * const masterlist
|
||||
|
||||
std::list<boss::Plugin> temp;
|
||||
std::list<boss::Plugin> userTemp;
|
||||
try {
|
||||
YAML::Node tempNode = YAML::LoadFile(masterlistPath);
|
||||
temp = tempNode["plugins"].as< std::list<boss::Plugin> >();
|
||||
|
||||
tempNode = YAML::LoadFile(userlistPath);
|
||||
try {
|
||||
if (boost::algorithm::iends_with(masterlistPath, ".yaml")) {
|
||||
YAML::Node tempNode = YAML::LoadFile(masterlistPath);
|
||||
temp = tempNode["plugins"].as< std::list<boss::Plugin> >();
|
||||
} else {
|
||||
boost::filesystem::path p(masterlistPath);
|
||||
Loadv2Masterlist(p, temp);
|
||||
}
|
||||
} catch (YAML::Exception& e) {
|
||||
extMessageStr = e.what();
|
||||
return boss_error_parse_fail;
|
||||
} catch (boss::error& e) {
|
||||
extMessageStr = e.what();
|
||||
return boss_error_parse_fail;
|
||||
}
|
||||
|
||||
try {
|
||||
YAML::Node tempNode = YAML::LoadFile(userlistPath);
|
||||
userTemp = tempNode["plugins"].as< std::list<boss::Plugin> >();
|
||||
} catch (YAML::Exception& e) {
|
||||
extMessageStr = e.what();
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace boss {
|
||||
//BOSSv2 supports Chinese and German in addition to English, Russian and Spanish, but they aren't used in any of the masterlists so don't bother mapping them.
|
||||
unsigned int langInt;
|
||||
if (lang == "english")
|
||||
langInt = g_lang_any;
|
||||
langInt = g_lang_english;
|
||||
else if (lang == "russian")
|
||||
langInt = g_lang_russian;
|
||||
else if (lang == "spanish")
|
||||
|
||||
Reference in New Issue
Block a user