MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / write_config

Function write_config

tests/unittests/test_server_config.cpp:25–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 std::filesystem::remove_all(root, ec);
24 std::filesystem::create_directories(root);
25 return root;
26}
27
28std::filesystem::path write_config(
29 const std::filesystem::path & root,
30 const std::string & name,
31 const std::string & text) {
32 const auto path = root / name;
33 std::ofstream out(path);
34 if (!out) {
35 throw std::runtime_error("failed to create test config: " + path.string());
36 }
37 out << text;
38 if (!out) {
39 throw std::runtime_error("failed to write test config: " + path.string());
40 }
41 return path;
42}

Calls

no outgoing calls

Tested by

no test coverage detected