[Bf-blender-cvs] [a2412868591] master: Cycles: Util, add to_string() with some helper
fclem
noreply at git.blender.org
Thu Aug 9 15:57:59 CEST 2018
Commit: a241286859114c6091a86186aa680d638917a05a
Author: fclem
Date: Thu Aug 9 15:27:19 2018 +0200
Branches: master
https://developer.blender.org/rBa241286859114c6091a86186aa680d638917a05a
Cycles: Util, add to_string() with some helper
Currently unused, but will allow to convert unknown
argument type to a string for reporting and such.
===================================================================
M intern/cycles/util/util_string.cpp
M intern/cycles/util/util_string.h
===================================================================
diff --git a/intern/cycles/util/util_string.cpp b/intern/cycles/util/util_string.cpp
index 995f5d3df27..47119e90a45 100644
--- a/intern/cycles/util/util_string.cpp
+++ b/intern/cycles/util/util_string.cpp
@@ -168,6 +168,11 @@ string string_from_bool(bool var)
return "False";
}
+string to_string(const char *str)
+{
+ return string(str);
+}
+
/* Wide char strings helpers for Windows. */
#ifdef _WIN32
diff --git a/intern/cycles/util/util_string.h b/intern/cycles/util/util_string.h
index 7dfa97335a9..3a4f4398158 100644
--- a/intern/cycles/util/util_string.h
+++ b/intern/cycles/util/util_string.h
@@ -29,6 +29,7 @@ using std::string;
using std::stringstream;
using std::ostringstream;
using std::istringstream;
+using std::to_string;
#ifdef __GNUC__
#define PRINTF_ATTRIBUTE __attribute__((format(printf, 1, 2)))
@@ -49,6 +50,7 @@ bool string_endswith(const string& s, const char *end);
string string_strip(const string& s);
string string_remove_trademark(const string& s);
string string_from_bool(const bool var);
+string to_string(const char *str);
/* Wide char strings are only used on Windows to deal with non-ascii
* characters in file names and such. No reason to use such strings
More information about the Bf-blender-cvs
mailing list