MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / LoadConfig

Method LoadConfig

src/plugin/kernel/src/AFCClassMetaModule.cpp:60–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60bool 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
86bool AFCClassMetaModule::LoadConfigMeta(const std::string& schema_path, std::shared_ptr<AFClassMeta> pClassMeta)
87{

Callers

nothing calls this directly

Calls 7

GetRootNodeMethod · 0.80
IsValidMethod · 0.80
NextNodeMethod · 0.80
CreateStaticMetaMethod · 0.80
SetResPathMethod · 0.80
FindNodeMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected