Skip to content

Class Argos::ColumnWidthTracker

ClassList > Argos > ColumnWidthTracker

Helper that tracks the width needed by each column of a worksheet. More...

  • #include <column_width_tracker.h>

Public Functions

Type Name
void applyToWorksheet (lxw_worksheet * ws) const
Apply the recorded widths to a libxlsxwriter worksheet.
void measureDouble (int col, double value, const char * fmt="%.3f")
Account for the length of a formatted double in the given column.
void measureInt (int col, int64_t value)
Account for the length of an integer in the given column.
void measureString (int col, const std::string & text)
Account for the length of a string in the given column.

Detailed Description

Cells are measured via the measure* methods; the final widths are then applied to a libxlsxwriter worksheet with applyToWorksheet.

Public Functions Documentation

function applyToWorksheet

Apply the recorded widths to a libxlsxwriter worksheet.

void Argos::ColumnWidthTracker::applyToWorksheet (
    lxw_worksheet * ws
) const

Each measured width is clamped to MIN_WIDTH and padded with PADDING before being set on the worksheet.

Parameters:

  • ws Target worksheet.

function measureDouble

Account for the length of a formatted double in the given column.

void Argos::ColumnWidthTracker::measureDouble (
    int col,
    double value,
    const char * fmt="%.3f"
) 

Parameters:

  • col Zero-based column index.
  • value Value that will be written in the column.
  • fmt printf-style format used to render value.

function measureInt

Account for the length of an integer in the given column.

void Argos::ColumnWidthTracker::measureInt (
    int col,
    int64_t value
) 

Parameters:

  • col Zero-based column index.
  • value Value that will be written in the column.

function measureString

Account for the length of a string in the given column.

void Argos::ColumnWidthTracker::measureString (
    int col,
    const std::string & text
) 

Parameters:

  • col Zero-based column index.
  • text Text that will be written in the column.


The documentation for this class was generated from the following file benchmark/exporter/column_width_tracker.h