trunk: sync from 1.4.3

make & cmake fixes
This commit is contained in:
Marian Krivos
2012-02-04 17:03:09 +00:00
parent 0afd04898b
commit 8b70c37260
55 changed files with 2797 additions and 2229 deletions

View File

@@ -37,7 +37,9 @@
#include "Poco/NumberFormatter.h"
#include "Poco/MemoryStream.h"
#include <iomanip>
#if !defined(POCO_NO_LOCALE)
#include <locale>
#endif
#include <cstdio>
#include <cctype>
@@ -361,9 +363,11 @@ void NumberFormatter::append(std::string& str, float value)
{
char buffer[64];
Poco::MemoryOutputStream ostr(buffer, sizeof(buffer));
#if !defined(POCO_NO_LOCALE)
ostr.imbue(std::locale::classic());
#endif
ostr << std::setprecision(8) << value;
str.append(buffer, ostr.charsWritten());
str.append(buffer, static_cast<std::string::size_type>(ostr.charsWritten()));
}
@@ -371,33 +375,39 @@ void NumberFormatter::append(std::string& str, double value)
{
char buffer[64];
Poco::MemoryOutputStream ostr(buffer, sizeof(buffer));
#if !defined(POCO_NO_LOCALE)
ostr.imbue(std::locale::classic());
#endif
ostr << std::setprecision(16) << value;
str.append(buffer, ostr.charsWritten());
str.append(buffer, static_cast<std::string::size_type>(ostr.charsWritten()));
}
void NumberFormatter::append(std::string& str, double value, int precision)
{
poco_assert (precision >= 0 && precision < 32);
poco_assert (precision >= 0 && precision < 32);
char buffer[64];
Poco::MemoryOutputStream ostr(buffer, sizeof(buffer));
#if !defined(POCO_NO_LOCALE)
ostr.imbue(std::locale::classic());
#endif
ostr << std::fixed << std::showpoint << std::setprecision(precision) << value;
str.append(buffer, ostr.charsWritten());
str.append(buffer, static_cast<std::string::size_type>(ostr.charsWritten()));
}
void NumberFormatter::append(std::string& str, double value, int width, int precision)
{
poco_assert (width > 0 && width < 64 && precision >= 0 && precision < width);
poco_assert (width > 0 && width < 64 && precision >= 0 && precision < width);
char buffer[64];
Poco::MemoryOutputStream ostr(buffer, sizeof(buffer));
#if !defined(POCO_NO_LOCALE)
ostr.imbue(std::locale::classic());
#endif
ostr << std::fixed << std::showpoint << std::setw(width) << std::setprecision(precision) << value;
str.append(buffer, ostr.charsWritten());
str.append(buffer, static_cast<std::string::size_type>(ostr.charsWritten()));
}