Spectre/Core/String: Adding to_string() for signed int.
This commit is contained in:
parent
c731cda1a2
commit
66a4011f4b
2 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,8 @@ namespace sp { namespace core
|
||||||
{
|
{
|
||||||
// Convertion functions from standard c/c++ types.
|
// Convertion functions from standard c/c++ types.
|
||||||
|
|
||||||
|
std::string to_string(int value);
|
||||||
|
|
||||||
std::string to_string(unsigned int value);
|
std::string to_string(unsigned int value);
|
||||||
|
|
||||||
std::string to_string(float value);
|
std::string to_string(float value);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,13 @@
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
|
|
||||||
|
std::string core::to_string(int value)
|
||||||
|
{
|
||||||
|
char buf[32];
|
||||||
|
sprintf(buf, "%i", value);
|
||||||
|
return std::string(buf);
|
||||||
|
}
|
||||||
|
|
||||||
std::string core::to_string(unsigned int value)
|
std::string core::to_string(unsigned int value)
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue