@ -120,14 +120,55 @@ bool Toa(int value, CharType * buffer, size_t buf_len, int base = 10)
}
/*
these methos don ' t take the buffer size
make sure the buffer size is sufficient big
2 ^ 64 - 1 = 18446744073709551615 = 20 characters ( plus minus sign and plus terminating zero )
so the buffer should have at least 22 characters
! ! CHECK ME check the size whether is correct
*/
template < class CharType >
bool Toa ( unsigned long value , CharType * buffer )
{
size_t sufficient_space = 25 ;
return Toa ( value , buffer , sufficient_space ) ;
}
template < class CharType >
bool Toa ( long value , CharType * buffer )
{
size_t sufficient_space = 25 ;
return Toa ( value , buffer , sufficient_space ) ;
}
template < class CharType >
bool Toa ( unsigned int value , CharType * buffer )
{
size_t sufficient_space = 25 ;
return Toa ( value , buffer , sufficient_space ) ;
}
template < class CharType >
bool Toa ( int value , CharType * buffer )
{
size_t sufficient_space = 25 ;
return Toa ( value , buffer , sufficient_space ) ;
}
// warning: it uses its own static buffer
// one buffer for both these functions
// !! REMOVE ME they are deprecated (don't use it)
const wchar_t * Toa ( unsigned int value , int base = 10 ) ;
const wchar_t * Toa ( unsigned long value , int base = 10 ) ;
const wchar_t * Toa ( int value , int base = 10 ) ;
const wchar_t * Toa ( long value , int base = 10 ) ;
void Toa ( int value , std : : string & res , int base = 10 , bool clear = true ) ;
void Toa ( long value , std : : string & res , int base = 10 , bool clear = true ) ;
void Toa ( int value , std : : wstring & res , int base = 10 , bool clear = true ) ;