mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmGlobalXCodeGenerator: Convert CreateString signature to string_view
This commit is contained in:
@@ -850,7 +850,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
cmXCodeObject* cmGlobalXCodeGenerator::CreateString(std::string const& s)
|
||||
cmXCodeObject* cmGlobalXCodeGenerator::CreateString(cm::string_view s)
|
||||
{
|
||||
cmXCodeObject* obj = this->CreateObject(cmXCodeObject::STRING);
|
||||
obj->SetString(s);
|
||||
|
||||
@@ -192,7 +192,7 @@ private:
|
||||
cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype,
|
||||
cm::string_view key = {});
|
||||
cmXCodeObject* CreateObject(cmXCodeObject::Type type);
|
||||
cmXCodeObject* CreateString(std::string const& s);
|
||||
cmXCodeObject* CreateString(cm::string_view s);
|
||||
cmXCodeObject* CreateObjectReference(cmXCodeObject*);
|
||||
cmXCodeObject* CreateFlatClone(cmXCodeObject*);
|
||||
cmXCodeObject* CreateXCodeTarget(cmGeneratorTarget* gtgt,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include <cm/string_view>
|
||||
#include <cmext/string_view>
|
||||
|
||||
char const* cmXCodeObject::PBXTypeNames[] = {
|
||||
@@ -225,7 +226,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const
|
||||
cmXCodeObject::PrintString(os, this->String);
|
||||
}
|
||||
|
||||
void cmXCodeObject::SetString(std::string const& s)
|
||||
void cmXCodeObject::SetString(cm::string_view s)
|
||||
{
|
||||
this->String = s;
|
||||
this->String = std::string(s);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <cm/string_view>
|
||||
#include <cmext/algorithm>
|
||||
|
||||
class cmGeneratorTarget;
|
||||
@@ -64,7 +65,7 @@ public:
|
||||
|
||||
bool IsEmpty() const;
|
||||
|
||||
void SetString(std::string const& s);
|
||||
void SetString(cm::string_view s);
|
||||
std::string const& GetString() const { return this->String; }
|
||||
|
||||
void AddAttribute(std::string const& name, cmXCodeObject* value)
|
||||
|
||||
Reference in New Issue
Block a user