@ -52,7 +52,7 @@ namespace PT
// if the buffer is too small it will be terminated at the beginning (empty string)
// and the function returns false
template < class CharType >
bool Toa ( unsigned long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
bool Toa ( unsigned long long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
size_t i1 , i2 ;
long rest ;
@ -105,7 +105,7 @@ return true;
// if the buffer is too small it will be terminated at the beginning (empty string)
// and the function returns false
template < class CharType >
bool Toa ( long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
bool Toa ( long long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
if ( len_out )
* len_out = 0 ;
@ -125,7 +125,7 @@ bool Toa(long value, CharType * buffer, size_t buf_len, int base = 10, size_t *
is_sign = true ;
}
bool res = Toa ( static_cast < unsigned long > ( value ) , buf , buf_len , base , len_out ) ;
bool res = Toa ( static_cast < unsigned long long > ( value ) , buf , buf_len , base , len_out ) ;
if ( res )
{
@ -144,12 +144,46 @@ return res;
template < class CharType >
bool Toa ( unsigned long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < unsigned long long > ( value ) , buffer , buf_len , base , len_out ) ;
}
template < class CharType >
bool Toa ( long value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < long long > ( value ) , buffer , buf_len , base , len_out ) ;
}
template < class CharType >
bool Toa ( unsigned int value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < unsigned long long > ( value ) , buffer , buf_len , base , len_out ) ;
}
template < class CharType >
bool Toa ( int value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < long long > ( value ) , buffer , buf_len , base , len_out ) ;
}
template < class CharType >
bool Toa ( unsigned short value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < unsigned long long > ( value ) , buffer , buf_len , base , len_out ) ;
}
template < class CharType >
bool Toa ( short value , CharType * buffer , size_t buf_len , int base = 10 , size_t * len_out = 0 )
{
return Toa ( static_cast < long long > ( value ) , buffer , buf_len , base , len_out ) ;
}