forked from bartvdbraak/blender
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.
This commit is contained in:
parent
3aee3bbac7
commit
a241286859
@ -168,6 +168,11 @@ string string_from_bool(bool var)
|
|||||||
return "False";
|
return "False";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string to_string(const char *str)
|
||||||
|
{
|
||||||
|
return string(str);
|
||||||
|
}
|
||||||
|
|
||||||
/* Wide char strings helpers for Windows. */
|
/* Wide char strings helpers for Windows. */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -29,6 +29,7 @@ using std::string;
|
|||||||
using std::stringstream;
|
using std::stringstream;
|
||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
using std::istringstream;
|
using std::istringstream;
|
||||||
|
using std::to_string;
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define PRINTF_ATTRIBUTE __attribute__((format(printf, 1, 2)))
|
#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_strip(const string& s);
|
||||||
string string_remove_trademark(const string& s);
|
string string_remove_trademark(const string& s);
|
||||||
string string_from_bool(const bool var);
|
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
|
/* 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
|
* characters in file names and such. No reason to use such strings
|
||||||
|
Loading…
Reference in New Issue
Block a user