Added Vaca::convert_to<std::string>(int).

This commit is contained in:
David Capello 2010-07-03 13:30:33 -03:00
parent 2a65c24f74
commit 263c9d4e6e
2 changed files with 10 additions and 2 deletions

View File

@ -82,7 +82,10 @@ namespace Vaca {
return convert_to<std::string, const Char*>(from);
}
// Convert to String
// Convert to std::string
template<> VACA_DLL std::string convert_to(const int& from);
// Convert to std::wstring
template<> VACA_DLL String convert_to(const std::string& from);
template<> VACA_DLL String convert_to(const int& from);
template<> VACA_DLL String convert_to(const long& from);

View File

@ -195,7 +195,12 @@ template<> double Vaca::convert_to(const String& from)
return std::wcstod(from.c_str(), NULL);
}
template<> String Vaca::convert_to(const int& from)
template<> std::string Vaca::convert_to(const int& from)
{
return format_string("%d", from);
}
template<> std::wstring Vaca::convert_to(const int& from)
{
return format_string(L"%d", from);
}