cmSystemTools: Take view instead of ref as parameter

This commit is contained in:
John Franklin Rickard
2026-02-06 12:27:23 -05:00
committed by Brad King
parent 9daa1012d4
commit 35af170961
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -4393,7 +4393,7 @@ char cmSystemTools::GetSystemPathlistSeparator()
#endif
}
cm::string_view cmSystemTools::GetFilenameNameView(std::string const& filename)
cm::string_view cmSystemTools::GetFilenameNameView(cm::string_view filename)
{
// implementation mostly taken from cmsys::SystemTools
#if defined(_WIN32) || defined(KWSYS_SYSTEMTOOLS_SUPPORT_WINDOWS_SLASHES)
@@ -4410,7 +4410,7 @@ cm::string_view cmSystemTools::GetFilenameNameView(std::string const& filename)
}
cm::string_view cmSystemTools::GetFilenameLastExtensionView(
std::string const& filename)
cm::string_view filename)
{
cm::string_view name = cmSystemTools::GetFilenameNameView(filename);
cm::string_view::size_type dot_pos = name.rfind('.');
+2 -2
View File
@@ -706,14 +706,14 @@ public:
static char GetSystemPathlistSeparator();
/** Return subview of the full filename (i.e. file name without path) */
static cm::string_view GetFilenameNameView(std::string const& filename);
static cm::string_view GetFilenameNameView(cm::string_view filename);
/**
* Return subview of file extension of a full filename (dot included).
* Warning: this is the shortest extension (for example: .gz of .tar.gz)
*/
static cm::string_view GetFilenameLastExtensionView(
std::string const& filename);
cm::string_view filename);
private:
static bool s_ForceUnixPaths;