mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3129 Table Formatter : Add support for creating tables prefixed with comment string
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
enum RifEclipseOutputTableLineType
|
||||
{
|
||||
COMMENT,
|
||||
CONTENTS
|
||||
CONTENTS,
|
||||
HORIZONTAL_LINE
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -106,15 +107,18 @@ public:
|
||||
virtual ~RifEclipseDataTableFormatter();
|
||||
|
||||
void setColumnSpacing(int spacing);
|
||||
void setTableRowPrependText(const QString& text);
|
||||
void setTableRowLineAppendText(const QString& text);
|
||||
|
||||
RifEclipseDataTableFormatter& keyword(const QString keyword);
|
||||
RifEclipseDataTableFormatter& keyword(const QString& keyword);
|
||||
RifEclipseDataTableFormatter& header(std::vector<RifEclipseOutputTableColumn> tableHeader);
|
||||
RifEclipseDataTableFormatter& add(const QString str);
|
||||
RifEclipseDataTableFormatter& add(const QString& str);
|
||||
RifEclipseDataTableFormatter& add(double num);
|
||||
RifEclipseDataTableFormatter& add(int num);
|
||||
RifEclipseDataTableFormatter& add(size_t num);
|
||||
RifEclipseDataTableFormatter& addZeroBasedCellIndex(size_t index);
|
||||
RifEclipseDataTableFormatter& comment(const QString str);
|
||||
RifEclipseDataTableFormatter& comment(const QString& str);
|
||||
RifEclipseDataTableFormatter& addHorizontalLine(const QChar& str);
|
||||
void rowCompleted();
|
||||
void tableCompleted();
|
||||
|
||||
@@ -124,13 +128,16 @@ private:
|
||||
int measure(int num);
|
||||
int measure(size_t num);
|
||||
|
||||
int tableWidth() const;
|
||||
|
||||
QString format(double num, RifEclipseOutputTableDoubleFormatting doubleFormat);
|
||||
QString format(int num);
|
||||
QString format(size_t num);
|
||||
QString formatColumn(const QString str, RifEclipseOutputTableColumn column);
|
||||
QString formatColumn(const QString str, RifEclipseOutputTableColumn column) const;
|
||||
|
||||
void outputBuffer();
|
||||
void outputComment(RifEclipseOutputTableLine& comment);
|
||||
void outputHorizontalLine(RifEclipseOutputTableLine& comment);
|
||||
|
||||
private:
|
||||
std::vector<RifEclipseOutputTableColumn> m_columns;
|
||||
@@ -138,4 +145,6 @@ private:
|
||||
std::vector<QString> m_lineBuffer;
|
||||
QTextStream& m_out;
|
||||
int m_colSpacing;
|
||||
QString m_tableRowPrependText;
|
||||
QString m_tableRowAppendText;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user