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

Method append_separator_if_needed

src/path.cpp:651–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649// append_separator_if_needed ------------------------------------------------------//
650
651BOOST_FILESYSTEM_DECL path_algorithms::string_type::size_type path_algorithms::append_separator_if_needed(path& p)
652{
653 string_type::size_type size(p.m_pathname.size());
654 if (size > static_cast< string_type::size_type >(0) &&
655#ifdef BOOST_FILESYSTEM_WINDOWS_API
656 p.m_pathname[size - 1] != colon &&
657#endif
658 !detail::is_directory_separator(p.m_pathname[size - 1]))
659 {
660 p.m_pathname.push_back(path::preferred_separator);
661 return size;
662 }
663 return 0;
664}
665
666// erase_redundant_separator -------------------------------------------------------//
667

Callers

nothing calls this directly

Calls 2

is_directory_separatorFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected