Poco::Data

class SimpleRowFormatter

Library: Data
Package: DataCore
Header: Poco/Data/SimpleRowFormatter.h

Description

A simple row formatting class.

Inheritance

Direct Base Classes: RowFormatter

All Base Classes: RowFormatter

Member Summary

Member Functions: formatNames, formatValues, getColumnWidth, getSpacing, operator =, rowCount, setColumnWidth, swap

Inherited Functions: formatNames, formatValues, getMode, getTotalRowCount, postfix, prefix, reset, rowCount, setMode, setPostfix, setPrefix, setTotalRowCount, toString

Constructors

SimpleRowFormatter

SimpleRowFormatter(
    const SimpleRowFormatter & other
);

Creates the copy of the supplied SimpleRowFormatter.

SimpleRowFormatter

SimpleRowFormatter(
    std::streamsize columnWidth = DEFAULT_COLUMN_WIDTH,
    std::streamsize spacing = DEFAULT_SPACING
);

Creates the SimpleRowFormatter and sets the column width to specified value.

Destructor

~SimpleRowFormatter virtual

~SimpleRowFormatter();

Destroys the SimpleRowFormatter.

Member Functions

formatNames virtual

std::string & formatNames(
    const NameVecPtr pNames,
    std::string & formattedNames
);

Formats the row field names.

formatValues virtual

std::string & formatValues(
    const ValueVec & vals,
    std::string & formattedValues
);

Formats the row values.

getColumnWidth inline

std::streamsize getColumnWidth() const;

Returns the column width.

getSpacing inline

std::streamsize getSpacing() const;

Returns the spacing.

operator =

SimpleRowFormatter & operator = (
    const SimpleRowFormatter & row
);

Assignment operator.

rowCount virtual inline

int rowCount() const;

Returns row count.

setColumnWidth inline

void setColumnWidth(
    std::streamsize width
);

Sets the column width.

swap

void swap(
    SimpleRowFormatter & other
);

Swaps the row formatter with another one.

Variables

DEFAULT_COLUMN_WIDTH static

static const int DEFAULT_COLUMN_WIDTH = 16;

DEFAULT_SPACING static

static const int DEFAULT_SPACING = 1;