- SQL logging channel and archiving strategy

- row formatting refactored
- affected row count for insert, delete and update returned from Statement::execute()
- internal SQL string formatting capability using Poco::format()
This commit is contained in:
Aleksandar Fabijanic
2008-01-12 18:25:27 +00:00
parent b57f579d16
commit 9e8e627347
63 changed files with 2556 additions and 337 deletions

View File

@@ -43,14 +43,7 @@ namespace Poco {
namespace Data {
RowFormatter::RowFormatter(std::streamsize width):
_width(width)
{
}
RowFormatter::RowFormatter(const std::string& prefix, const std::string& postfix):
_width(DEFAULT_COLUMN_WIDTH),
_prefix(prefix),
_postfix(postfix)
{
@@ -62,44 +55,4 @@ RowFormatter::~RowFormatter()
}
std::string& RowFormatter::formatNames(const NameVecPtr pNames, std::string& formattedNames) const
{
std::ostringstream str;
std::string line(_width * pNames->size(), '-');
NameVec::const_iterator it = pNames->begin();
NameVec::const_iterator end = pNames->end();
for (; it != end; ++it)
{
str << std::left << std::setw(_width) << *it;
}
str << std::endl << line << std::endl;
return formattedNames = str.str();
}
std::string& RowFormatter::formatValues(const ValueVec& vals, std::string& formattedValues) const
{
std::ostringstream str;
ValueVec::const_iterator it = vals.begin();
ValueVec::const_iterator end = vals.end();
for (; it != end; ++it)
{
if (it->isNumeric())
{
str << std::right
<< std::fixed
<< std::setprecision(2);
}
else str << std::left;
str << std::setw(_width) << it->convert<std::string>();
}
str << std::endl;
return formattedValues = str.str();
}
} } // namespace Poco::Data