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

Function system_complete

src/operations.cpp:4830–4867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4828}
4829
4830BOOST_FILESYSTEM_DECL
4831path system_complete(path const& p, system::error_code* ec)
4832{
4833#ifdef BOOST_FILESYSTEM_POSIX_API
4834
4835 if (p.empty() || p.is_absolute())
4836 return p;
4837
4838 path res(current_path());
4839 path_algorithms::append_v4(res, p);
4840 return res;
4841
4842#else
4843
4844 if (p.empty())
4845 {
4846 if (ec)
4847 ec->clear();
4848 return p;
4849 }
4850
4851 BOOST_CONSTEXPR_OR_CONST std::size_t buf_size = 128u;
4852 wchar_t buf[buf_size];
4853 wchar_t* pfn;
4854 std::size_t len = get_full_path_name(p, buf_size, buf, &pfn);
4855
4856 if (error(len == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::system_complete"))
4857 return path();
4858
4859 if (len < buf_size) // len does not include null termination character
4860 return path(&buf[0]);
4861
4862 std::unique_ptr< wchar_t[] > big_buf(new wchar_t[len]);
4863
4864 return error(get_full_path_name(p, len, big_buf.get(), &pfn) == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::system_complete") ? path() : path(big_buf.get());
4865
4866#endif
4867}
4868
4869BOOST_FILESYSTEM_DECL
4870path weakly_canonical_v3(path const& p, path const& base, system::error_code* ec)

Callers 2

mainFunction · 0.50
platform_specific_testsFunction · 0.50

Calls 8

get_full_path_nameFunction · 0.85
errorFunction · 0.85
is_absoluteMethod · 0.80
clearMethod · 0.80
getMethod · 0.80
current_pathFunction · 0.70
pathFunction · 0.50
emptyMethod · 0.45

Tested by 1

platform_specific_testsFunction · 0.40