Integrated legacy parser into API.

This commit is contained in:
WrinklyNinja
2013-07-27 08:04:34 +01:00
parent 16993d6379
commit befca3083a
2 changed files with 20 additions and 5 deletions
+19 -4
View File
@@ -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();
+1 -1
View File
@@ -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")