summaryrefslogtreecommitdiffstats
path: root/Source/cmStateDirectory.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-08-09 15:58:45 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-08-12 08:59:21 (GMT)
commitada121e573fb1a4c2d4ea5ee2ee51daca80d4de8 (patch)
treef7c7c16ff5e3011073d00e4be9b9bc1ff28f96ce /Source/cmStateDirectory.cxx
parenteba2b13a835000a614f21a1205a598462a4f8843 (diff)
downloadCMake-ada121e573fb1a4c2d4ea5ee2ee51daca80d4de8.zip
CMake-ada121e573fb1a4c2d4ea5ee2ee51daca80d4de8.tar.gz
CMake-ada121e573fb1a4c2d4ea5ee2ee51daca80d4de8.tar.bz2
cmStateDirectory: use const std::string& for return values
Diffstat (limited to 'Source/cmStateDirectory.cxx')
-rw-r--r--Source/cmStateDirectory.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 6eac8e2..925b161 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -84,9 +84,9 @@ void cmStateDirectory::ComputeRelativePathTopBinary()
}
}
-const char* cmStateDirectory::GetCurrentSource() const
+std::string const& cmStateDirectory::GetCurrentSource() const
{
- return this->DirectoryState->Location.c_str();
+ return this->DirectoryState->Location;
}
void cmStateDirectory::SetCurrentSource(std::string const& dir)
@@ -101,9 +101,9 @@ void cmStateDirectory::SetCurrentSource(std::string const& dir)
this->Snapshot_.SetDefinition("CMAKE_CURRENT_SOURCE_DIR", loc);
}
-const char* cmStateDirectory::GetCurrentBinary() const
+std::string const& cmStateDirectory::GetCurrentBinary() const
{
- return this->DirectoryState->OutputLocation.c_str();
+ return this->DirectoryState->OutputLocation;
}
void cmStateDirectory::SetCurrentBinary(std::string const& dir)
@@ -118,14 +118,14 @@ void cmStateDirectory::SetCurrentBinary(std::string const& dir)
this->Snapshot_.SetDefinition("CMAKE_CURRENT_BINARY_DIR", loc);
}
-const char* cmStateDirectory::GetRelativePathTopSource() const
+std::string const& cmStateDirectory::GetRelativePathTopSource() const
{
- return this->DirectoryState->RelativePathTopSource.c_str();
+ return this->DirectoryState->RelativePathTopSource;
}
-const char* cmStateDirectory::GetRelativePathTopBinary() const
+std::string const& cmStateDirectory::GetRelativePathTopBinary() const
{
- return this->DirectoryState->RelativePathTopBinary.c_str();
+ return this->DirectoryState->RelativePathTopBinary;
}
void cmStateDirectory::SetRelativePathTopSource(const char* dir)
@@ -474,7 +474,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
if (prop == "PARENT_DIRECTORY") {
cmStateSnapshot parent = this->Snapshot_.GetBuildsystemDirectoryParent();
if (parent.IsValid()) {
- return parent.GetDirectory().GetCurrentSource();
+ return parent.GetDirectory().GetCurrentSource().c_str();
}
return "";
}