mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
Add support for (unsigned) long long when long is 64bit
This commit is contained in:
@@ -234,7 +234,102 @@ void NumberFormatter::appendHex(std::string& str, unsigned long value, int width
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append0(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, unsigned long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append0(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, unsigned long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 0x10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 0x10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
#else // ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, Int64 value)
|
||||
@@ -327,7 +422,9 @@ void NumberFormatter::appendHex(std::string& str, UInt64 value, int width)
|
||||
}
|
||||
|
||||
|
||||
#endif // defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, float value)
|
||||
|
||||
Reference in New Issue
Block a user