MCPcopy Create free account
hub / github.com/DSVVA/MHY_Scanner / createDefaultConfigFile

Method createDefaultConfigFile

src/Core/ConfigDate.cpp:67–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void ConfigDate::createDefaultConfigFile(const std::string& filePath, const std::string& Config)
68{
69 std::filesystem::path directory = std::filesystem::path(filePath).parent_path();
70 if (!std::filesystem::exists(directory))
71 {
72 if (!std::filesystem::create_directories(directory))
73 {
74 std::cout << "无法创建配置文件夹。\n";
75 exit(0);
76 }
77 }
78 std::ofstream file(filePath);
79 if (file.is_open())
80 {
81 file << Config;
82 file.close();
83 std::cout << "创建并写入默认配置文件成功。\n";
84 }
85 else
86 {
87 std::cout << "无法创建配置文件。\n";
88 }
89}
90
91std::string ConfigDate::defaultConfig()
92{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected