MCPcopy Create free account
hub / github.com/Samsung/UTopia / getUniqueFilePath

Function getUniqueFilePath

tests/testutil/TestUtil.cpp:10–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8std::string getTmpDirPath() { return fs::temp_directory_path().string(); }
9
10std::string getUniqueFilePath(std::string Dir, std::string Name,
11 std::string Ext) {
12 unsigned Counter = 0;
13 fs::path Result = fs::path(Dir) / fs::path(Name);
14 if (!Ext.empty())
15 Result += "." + Ext;
16
17 while (fs::exists(Result)) {
18 Result = fs::path(Dir) / fs::path(Name + '-' + std::to_string(Counter++));
19 if (!Ext.empty())
20 Result += "." + Ext;
21 }
22
23 return Result;
24}
25
26} // namespace ftg

Callers 6

analyzeMethod · 0.85
generateMethod · 0.85
addMethod · 0.85
IRDataMethod · 0.85
compileMethod · 0.85
SourceFileManagerMethod · 0.85

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected