CMS 3D CMS Logo

OStreamColumn Class Reference

#include "FWCore/Utilities/interface/OStreamColumn.h"

Detailed Description

Description: Helper/IO manipulator for forming columns used in tabular output.

Usage:

An OStreamColumn object can be defined in two ways:

edm::OStreamColumn col1 {"FirstNames"}; // Default width is size of the string "FirstNames"
edm::OStreamColumn col2 {"LastNames", 30}; // Width is explicitly specifed as 30.

After created the column objects we, one can use them with anything that supports insertion operations (e.g.):

std::cout << col1 << col2 << '\n'; // Print column titles with the widths associated for col1 and col2.
for (auto const& name : names)
std::cout << col1(name.first()) << col2(name.last()) << '\n';

The values 'name.first()' and 'name.last()' are printed into a column with the width associated with col1 and col2, respectively.