MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / MakeTempDir

Function MakeTempDir

src/ConfigTest.cpp:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57fs::path MakeTempDir(const std::string& name) {
58#if defined(_WIN32) || defined(_WIN64)
59 const auto suffix = std::to_string(GetCurrentProcessId());
60#else
61 const auto suffix = std::to_string(getpid());
62#endif
63 fs::path dir = fs::temp_directory_path() / (name + "-" + suffix);
64 fs::remove_all(dir);
65 fs::create_directories(dir);
66 return dir;
67}
68
69void WriteFile(const fs::path& path, const std::string& content) {
70 std::ofstream ofs(path, std::ios::binary);

Callers 1

TEST_FFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected