From 8b56d0792cace06693b18af3fe848f66434fc4cd Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 11 Sep 2013 20:36:38 -0400 Subject: CREATE_PROJECT: Remove usage of std::to_string() --- devtools/create_project/create_project.cpp | 6 +++++- devtools/create_project/create_project.h | 8 ++++++++ devtools/create_project/msbuild.cpp | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 3ee5fc4f97..7ae2df35c8 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -39,7 +39,7 @@ #include #include - +#include #include #include #include @@ -966,6 +966,10 @@ bool producesObjectFile(const std::string &fileName) { return false; } +std::string toString(int num) { + return static_cast(&(std::ostringstream() << num))->str(); +} + /** * Checks whether the give file in the specified directory is present in the given * file list. diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index d0f2db364c..5325bf6d1b 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -302,6 +302,14 @@ void splitFilename(const std::string &fileName, std::string &name, std::string & */ bool producesObjectFile(const std::string &fileName); +/** +* Convert an integer to string +* +* @param num the integer to convert +* @return string representation of the number +*/ +std::string toString(int num); + /** * Structure representing a file tree. This contains two * members: name and children. "name" holds the name of diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp index 7bab5c1078..0d68b2e9c9 100644 --- a/devtools/create_project/msbuild.cpp +++ b/devtools/create_project/msbuild.cpp @@ -116,8 +116,8 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri // Shared configuration project << "\t\n"; - std::string version = "v" + std::to_string(_version) + "0"; - std::string llvm = "LLVM-vs" + std::to_string(getVisualStudioVersion()); + std::string version = "v" + toString(_version) + "0"; + std::string llvm = "LLVM-vs" + toString(getVisualStudioVersion()); outputConfigurationType(setup, project, name, "Release|Win32", version); outputConfigurationType(setup, project, name, "Analysis|Win32", version); -- cgit v1.2.3