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

Method find_relative_path

src/path.cpp:755–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755BOOST_FILESYSTEM_DECL path_algorithms::substring path_algorithms::find_relative_path(path const& p)
756{
757 size_type root_name_size = 0;
758 size_type root_dir_pos = find_root_directory_start(p.m_pathname.c_str(), p.m_pathname.size(), root_name_size);
759
760 // Skip root name, root directory and any duplicate separators
761 size_type size = root_name_size;
762 if (root_dir_pos < p.m_pathname.size())
763 {
764 size = root_dir_pos + 1;
765
766 for (size_type n = p.m_pathname.size(); size < n; ++size)
767 {
768 if (!detail::is_directory_separator(p.m_pathname[size]))
769 break;
770 }
771 }
772
773 substring rel_path;
774 rel_path.pos = size;
775 rel_path.size = p.m_pathname.size() - size;
776
777 return rel_path;
778}
779
780BOOST_FILESYSTEM_DECL path_algorithms::string_type::size_type path_algorithms::find_parent_path_size(path const& p)
781{

Callers

nothing calls this directly

Calls 4

is_directory_separatorFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected