mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3910 Unit test for table formatter and split text
This commit is contained in:
@@ -77,6 +77,14 @@ QString RifEclipseDataTableFormatter::tableRowPrependText() const
|
||||
return m_tableRowPrependText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::tableRowAppendText() const
|
||||
{
|
||||
return m_tableRowAppendText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -93,6 +101,14 @@ void RifEclipseDataTableFormatter::setTableRowLineAppendText(const QString& text
|
||||
m_tableRowAppendText = text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifEclipseDataTableFormatter::commentPrefix() const
|
||||
{
|
||||
return m_commentPrefix;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -456,12 +472,13 @@ int RifEclipseDataTableFormatter::measure(size_t num)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RifEclipseDataTableFormatter::tableWidth() const
|
||||
{
|
||||
int characterCount = 0;
|
||||
int characterCount = m_tableRowPrependText.length();
|
||||
|
||||
for (size_t i = 0u; i < m_columns.size(); ++i)
|
||||
{
|
||||
characterCount += formatColumn(" ", i).size();
|
||||
}
|
||||
characterCount += m_tableRowAppendText.length();
|
||||
|
||||
return characterCount;
|
||||
}
|
||||
|
||||
@@ -114,8 +114,10 @@ public:
|
||||
int columnSpacing() const;
|
||||
void setColumnSpacing(int spacing);
|
||||
QString tableRowPrependText() const;
|
||||
QString tableRowAppendText() const;
|
||||
void setTableRowPrependText(const QString& text);
|
||||
void setTableRowLineAppendText(const QString& text);
|
||||
QString commentPrefix() const;
|
||||
void setCommentPrefix(const QString& commentPrefix);
|
||||
|
||||
RifEclipseDataTableFormatter& keyword(const QString& keyword);
|
||||
@@ -135,6 +137,8 @@ public:
|
||||
|
||||
static void addValueTable(QTextStream& stream, const QString& keyword, size_t columns, const std::vector<double>& values);
|
||||
|
||||
int tableWidth() const;
|
||||
static int maxEclipseRowWidth();
|
||||
|
||||
private:
|
||||
int measure(const QString str);
|
||||
@@ -142,9 +146,6 @@ private:
|
||||
int measure(int num);
|
||||
int measure(size_t num);
|
||||
|
||||
int tableWidth() const;
|
||||
static int maxEclipseRowWidth();
|
||||
|
||||
QString format(double num, RifEclipseOutputTableDoubleFormatting doubleFormat);
|
||||
QString format(int num);
|
||||
QString format(size_t num);
|
||||
|
||||
Reference in New Issue
Block a user