MCPcopy Create free account
hub / github.com/alibaba/MNN / ResetConfig

Method ResetConfig

apps/mnncli/src/cli_config_manager.cpp:337–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337bool ConfigManager::ResetConfig() {
338 try {
339 std::string config_file = GetConfigFilePath();
340
341 // Delete the config file if it exists
342 if (fs::exists(config_file)) {
343 fs::remove(config_file);
344 }
345
346 // Reset in-memory config to default
347 current_config_ = GetDefaultConfig();
348
349 // Reload to apply environment variables if any
350 LoadConfig();
351
352 return true;
353 } catch (const std::exception& e) {
354 std::cerr << "Failed to reset configuration: " << e.what() << std::endl;
355 return false;
356 }
357}
358
359} // namespace mnncli
360

Callers 1

HandleMethod · 0.80

Calls 2

existsFunction · 0.85
whatMethod · 0.45

Tested by

no test coverage detected