MCPcopy Create free account
hub / github.com/KDAB/codebrowser / canonicalize

Function canonicalize

generator/filesystem.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36std::error_code canonicalize(const llvm::Twine &path, llvm::SmallVectorImpl<char> &result) {
37 std::string p = path.str();
38#ifdef PATH_MAX
39 int path_max = PATH_MAX;
40#else
41 int path_max = pathconf(p.c_str(), _PC_PATH_MAX);
42 if (path_max <= 0)
43 path_max = 4096;
44#endif
45 result.resize(path_max);
46 realpath(p.c_str(), result.data());
47 result.resize(strlen(result.data()));
48 return {};
49}
50
51/* Based on the one from Support/Unix/PathV2 but with different default rights */
52static std::error_code create_directory(const llvm::Twine& path)

Callers 4

htmlNameForFileMethod · 0.85
pathToMethod · 0.85
addProjectMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected