add column spacing to SimpleRowFormatter, can be specified in ctor

This commit is contained in:
Guenter Obiltschnig 2014-09-23 22:43:00 +02:00
parent bbc356d269
commit 2e657d2a61

View File

@ -37,8 +37,9 @@ public:
//typedef RowFormatter::ValueVec ValueVec; //typedef RowFormatter::ValueVec ValueVec;
static const int DEFAULT_COLUMN_WIDTH = 16; static const int DEFAULT_COLUMN_WIDTH = 16;
static const int DEFAULT_SPACING = 1;
SimpleRowFormatter(std::streamsize columnWidth = DEFAULT_COLUMN_WIDTH); SimpleRowFormatter(std::streamsize columnWidth = DEFAULT_COLUMN_WIDTH, std::streamsize spacing = DEFAULT_SPACING);
/// Creates the SimpleRowFormatter and sets the column width to specified value. /// Creates the SimpleRowFormatter and sets the column width to specified value.
SimpleRowFormatter(const SimpleRowFormatter& other); SimpleRowFormatter(const SimpleRowFormatter& other);
@ -67,9 +68,13 @@ public:
std::streamsize getColumnWidth() const; std::streamsize getColumnWidth() const;
/// Returns the column width. /// Returns the column width.
std::streamsize getSpacing() const;
/// Returns the spacing.
private: private:
std::streamsize _colWidth; std::streamsize _colWidth;
std::streamsize _spacing;
int _rowCount; int _rowCount;
}; };
@ -95,6 +100,12 @@ inline std::streamsize SimpleRowFormatter::getColumnWidth() const
} }
inline std::streamsize SimpleRowFormatter::getSpacing() const
{
return _spacing;
}
} } // namespace Poco::Data } } // namespace Poco::Data