mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmSystemTools: Take view instead of ref as parameter
This commit is contained in:
committed by
Brad King
parent
9daa1012d4
commit
35af170961
@@ -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('.');
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user