MCPcopy Create free account
hub / github.com/boostorg/filesystem / canonicalize_root_path

Function canonicalize_root_path

test/operations_test.cpp:145–155  ·  view source on GitHub ↗

Converts root path of the argument to canonical form, i.e. "C:\" instead of "c:\" on Windows.

Source from the content-addressed store, hash-verified

143
144//! Converts root path of the argument to canonical form, i.e. "C:\" instead of "c:\" on Windows.
145inline fs::path canonicalize_root_path(fs::path const& p)
146{
147 fs::path root_path = p.root_path();
148 if (root_path.empty())
149 return p;
150 root_path = fs::canonical(root_path);
151 fs::path rel_path = p.relative_path();
152 if (!rel_path.empty())
153 root_path.append(rel_path);
154 return root_path;
155}
156
157#define CHECK_EXCEPTION(Functor, Expect) throws_fs_error(Functor, Expect, __LINE__)
158

Callers 3

canonical_basic_testsFunction · 0.70
cpp_mainFunction · 0.70

Calls 4

canonicalFunction · 0.85
root_pathMethod · 0.80
relative_pathMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected