summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r--Source/cmSourceFile.cxx25
1 files changed, 8 insertions, 17 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 23422a2..dd95f23 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -279,13 +279,8 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
}
//----------------------------------------------------------------------------
-void cmSourceFile::SetProperty(const char* prop, const char* value)
+void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
- if (!prop)
- {
- return;
- }
-
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
std::string ext =
@@ -293,7 +288,7 @@ void cmSourceFile::SetProperty(const char* prop, const char* value)
if (ext == ".ui")
{
cmMakefile const* mf = this->Location.GetMakefile();
- if (strcmp(prop, "AUTOUIC_OPTIONS") == 0)
+ if (prop == "AUTOUIC_OPTIONS")
{
const_cast<cmMakefile*>(mf)->AddQtUiFileWithOptions(this);
}
@@ -301,19 +296,15 @@ void cmSourceFile::SetProperty(const char* prop, const char* value)
}
//----------------------------------------------------------------------------
-void cmSourceFile::AppendProperty(const char* prop, const char* value,
+void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
bool asString)
{
- if (!prop)
- {
- return;
- }
this->Properties.AppendProperty(prop, value, cmProperty::SOURCE_FILE,
asString);
}
//----------------------------------------------------------------------------
-const char* cmSourceFile::GetPropertyForUser(const char *prop)
+const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
{
// This method is a consequence of design history and backwards
// compatibility. GetProperty is (and should be) a const method.
@@ -329,7 +320,7 @@ const char* cmSourceFile::GetPropertyForUser(const char *prop)
// cmSourceFileLocation class to commit to a particular full path to
// the source file as late as possible. If the users requests the
// LOCATION property we must commit now.
- if(strcmp(prop, "LOCATION") == 0)
+ if(prop == "LOCATION")
{
// Commit to a location.
this->GetFullPath();
@@ -340,10 +331,10 @@ const char* cmSourceFile::GetPropertyForUser(const char *prop)
}
//----------------------------------------------------------------------------
-const char* cmSourceFile::GetProperty(const char* prop) const
+const char* cmSourceFile::GetProperty(const std::string& prop) const
{
// Check for computed properties.
- if(strcmp(prop, "LOCATION") == 0)
+ if(prop == "LOCATION")
{
if(this->FullPath.empty())
{
@@ -368,7 +359,7 @@ const char* cmSourceFile::GetProperty(const char* prop) const
}
//----------------------------------------------------------------------------
-bool cmSourceFile::GetPropertyAsBool(const char* prop) const
+bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
{
return cmSystemTools::IsOn(this->GetProperty(prop));
}