MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetLastSeperatorPosition

Function GetLastSeperatorPosition

common/FileSystem.cpp:605–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605static std::string_view::size_type GetLastSeperatorPosition(const std::string_view filename, bool include_separator)
606{
607 std::string_view::size_type last_separator = filename.rfind('/');
608 if (include_separator && last_separator != std::string_view::npos)
609 last_separator++;
610
611#if defined(_WIN32)
612 std::string_view::size_type other_last_separator = filename.rfind('\\');
613 if (other_last_separator != std::string_view::npos)
614 {
615 if (include_separator)
616 other_last_separator++;
617 if (last_separator == std::string_view::npos || other_last_separator > last_separator)
618 last_separator = other_last_separator;
619 }
620#endif
621
622 return last_separator;
623}
624
625std::string_view Path::GetDirectory(const std::string_view path)
626{

Callers 5

GetDirectoryMethod · 0.85
GetFileNameMethod · 0.85
ChangeFileNameMethod · 0.85
AppendDirectoryMethod · 0.85
BuildRelativePathMethod · 0.85

Calls 1

rfindMethod · 0.80

Tested by

no test coverage detected