| 58 | } |
| 59 | |
| 60 | bool AFCClassMetaModule::LoadConfig() |
| 61 | { |
| 62 | std::string file_path = GetPluginManager()->GetResPath() + CONFIG_CLASS_FILE_PATH; |
| 63 | |
| 64 | ARK_LOG_INFO("Load config class files: {}", file_path); |
| 65 | |
| 66 | AFXml xml_doc(file_path); |
| 67 | auto root_node = xml_doc.GetRootNode(); |
| 68 | ARK_ASSERT_RET_VAL(root_node.IsValid(), false); |
| 69 | |
| 70 | for (auto meta_node = root_node.FindNode("config"); meta_node.IsValid(); meta_node.NextNode()) |
| 71 | { |
| 72 | std::string meta_name = meta_node.GetString("id"); |
| 73 | std::string schema_path = meta_node.GetString("meta"); |
| 74 | std::string res_path = meta_node.GetString("res"); |
| 75 | |
| 76 | auto pClassMeta = m_pClassMetaManager->CreateStaticMeta(meta_name); |
| 77 | ARK_ASSERT_RET_VAL(pClassMeta != nullptr, false); |
| 78 | |
| 79 | pClassMeta->SetResPath(res_path); |
| 80 | ARK_ASSERT_RET_VAL(LoadConfigMeta(schema_path, pClassMeta), false); |
| 81 | } |
| 82 | |
| 83 | return true; |
| 84 | } |
| 85 | |
| 86 | bool AFCClassMetaModule::LoadConfigMeta(const std::string& schema_path, std::shared_ptr<AFClassMeta> pClassMeta) |
| 87 | { |
nothing calls this directly
no test coverage detected