summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudioGeneratorOptions.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-23 17:58:22 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-23 18:56:51 (GMT)
commit8fa087ab38c41e76e502f438eff42d412962108f (patch)
tree6380c77aeb99b287bf4284b61b4220336e9bb36c /Source/cmVisualStudioGeneratorOptions.cxx
parent1c209ac165cd2c25c632cdd238a9948c1651f907 (diff)
downloadCMake-8fa087ab38c41e76e502f438eff42d412962108f.zip
CMake-8fa087ab38c41e76e502f438eff42d412962108f.tar.gz
CMake-8fa087ab38c41e76e502f438eff42d412962108f.tar.bz2
cmVisualStudioGeneratorOptions: Simplify XML escaping API
Accept arguments as std::string to avoid c_str() calls.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index f710780..2c43ad2 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -3,9 +3,9 @@
#include <cmsys/System.h>
#include "cmVisualStudio10TargetGenerator.h"
-inline std::string cmVisualStudio10GeneratorOptionsEscapeForXML(const char* s)
+static
+std::string cmVisualStudio10GeneratorOptionsEscapeForXML(std::string ret)
{
- std::string ret = s;
cmSystemTools::ReplaceString(ret, ";", "%3B");
cmSystemTools::ReplaceString(ret, "&", "&amp;");
cmSystemTools::ReplaceString(ret, "<", "&lt;");
@@ -13,9 +13,9 @@ inline std::string cmVisualStudio10GeneratorOptionsEscapeForXML(const char* s)
return ret;
}
-inline std::string cmVisualStudioGeneratorOptionsEscapeForXML(const char* s)
+static
+std::string cmVisualStudioGeneratorOptionsEscapeForXML(std::string ret)
{
- std::string ret = s;
cmSystemTools::ReplaceString(ret, "&", "&amp;");
cmSystemTools::ReplaceString(ret, "\"", "&quot;");
cmSystemTools::ReplaceString(ret, "<", "&lt;");
@@ -269,7 +269,7 @@ cmVisualStudioGeneratorOptions
// Escape this flag for the IDE.
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
{
- define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str());
+ define = cmVisualStudio10GeneratorOptionsEscapeForXML(define);
if(lang == "RC")
{
@@ -278,7 +278,7 @@ cmVisualStudioGeneratorOptions
}
else
{
- define = cmVisualStudioGeneratorOptionsEscapeForXML(define.c_str());
+ define = cmVisualStudioGeneratorOptionsEscapeForXML(define);
}
// Store the flag in the project file.
fout << sep << define;
@@ -379,8 +379,7 @@ cmVisualStudioGeneratorOptions
else
{
fout << prefix << "AdditionalOptions=\"";
- fout <<
- cmVisualStudioGeneratorOptionsEscapeForXML(this->FlagString.c_str());
+ fout << cmVisualStudioGeneratorOptionsEscapeForXML(this->FlagString);
fout << "\"" << suffix;
}
}