mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-06 03:32:14 +00:00
merge tindy2013
This commit is contained in:
1 parent
e88f8fd485
commit
090c2def1d
7 files changed
+666
-639
No files matched your search
@@ -800,7 +800,7 @@ void readConf()
|
||||
return readYAMLConf(yaml);
|
||||
}
|
||||
toml::value conf = parseToml(prefdata, global.prefPath);
|
||||
if(!conf.is_uninitialized() && toml::find_or<int>(conf, "version", 0))
|
||||
if(!conf.is_empty() && toml::find_or<int>(conf, "version", 0))
|
||||
return readTOMLConf(conf);
|
||||
}
|
||||
catch (YAML::Exception &e)
|
||||
@@ -1209,7 +1209,7 @@ int loadExternalConfig(std::string &path, ExternalConfig &ext)
|
||||
if(yaml.size() && yaml["custom"].IsDefined())
|
||||
return loadExternalYAML(yaml, ext);
|
||||
toml::value conf = parseToml(base_content, path);
|
||||
if(!conf.is_uninitialized() && toml::find_or<int>(conf, "version", 0))
|
||||
if(!conf.is_empty() && toml::find_or<int>(conf, "version", 0))
|
||||
return loadExternalTOML(conf, ext);
|
||||
}
|
||||
catch (YAML::Exception &e)
|
||||
|
||||
@@ -101,12 +101,12 @@ extern Settings global;
|
||||
|
||||
int importItems(string_array &target, bool scope_limit = true);
|
||||
int loadExternalConfig(std::string &path, ExternalConfig &ext);
|
||||
template <class T, class... U>
|
||||
void find_if_exist(const toml::value &v, const toml::key &k, T& target, U&&... args)
|
||||
{
|
||||
if(v.contains(k)) target = toml::find<T>(v, k);
|
||||
if constexpr (sizeof...(args) > 0) find_if_exist(v, std::forward<U>(args)...);
|
||||
}
|
||||
//template <class T, class... U>
|
||||
//void find_if_exist(const toml::value &v, const toml::key &k, T& target, U&&... args)
|
||||
//{
|
||||
// if(v.contains(k)) target = toml::find<T>(v, k);
|
||||
// if constexpr (sizeof...(args) > 0) find_if_exist(v, std::forward<U>(args)...);
|
||||
//}
|
||||
template <class... Args>
|
||||
void parseGroupTimes(const std::string &src, Args... args)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user