30 lines
789 B
C++
30 lines
789 B
C++
#pragma once
|
|
|
|
namespace Converter
|
|
{
|
|
struct String
|
|
{
|
|
inline static INT ToInt(const CHAR* pszString)
|
|
{ return atoi(pszString); }
|
|
inline static FLOAT ToFloat(const CHAR* pszString)
|
|
{ return (FLOAT)atof(pszString); }
|
|
inline static DWORD ToDWORD(const CHAR* pszString)
|
|
{ return (DWORD)atol(pszString); }
|
|
inline static DWORD64 ToDWORD64(const CHAR* pszString)
|
|
{ return (DWORD64)_atoi64(pszString); }
|
|
inline static WORD ToWORD(const CHAR* pszString)
|
|
{ return (WORD)atoi(pszString); }
|
|
inline static __int64 ToINT64(const CHAR* pszString)
|
|
{ return _atoi64(pszString); }
|
|
|
|
// ÃÖ´ë 32BIT
|
|
template<typename _TYPE>
|
|
inline static INT ToString(_TYPE value, CHAR* OUT pszString, INT iBufSize)
|
|
{
|
|
return (INT)_snprintf(pszString, iBufSize, "%u", value);
|
|
}
|
|
};
|
|
};
|
|
|
|
|