perf: 明确api参数及返回值类型,并兼容原先接口

This commit is contained in:
MistEO
2022-12-06 15:00:59 +08:00
parent ccc779bd7e
commit 2335e279b4
8 changed files with 123 additions and 128 deletions

View File

@@ -26,6 +26,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
auto full_path = path / Filename; \
bool ret = load_resource<Config>(full_path); \
if (!ret) { \
m_loaded = false; \
Log.error(#Config, " load failed, path:", full_path); \
return false; \
} \
@@ -38,6 +39,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
auto full_templ_dir = path / TemplDir; \
bool ret = load_resource_with_templ<Config>(full_path, full_templ_dir); \
if (!ret) { \
m_loaded = false; \
Log.error(#Config, "load failed, path:", full_path, ", templ dir:", full_templ_dir); \
return false; \
} \
@@ -72,3 +74,8 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
return true;
}
bool asst::ResourceLoader::loaded() const noexcept
{
return m_loaded;
}