#3464 Well Path Export. Add support for setting custom comment prefix in formatter

This commit is contained in:
Bjørn Erik Jensen
2018-11-01 10:02:30 +01:00
parent e634e28944
commit 2bd70b705e
2 changed files with 14 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ RifEclipseDataTableFormatter::RifEclipseDataTableFormatter(QTextStream& out)
, m_colSpacing(5)
, m_tableRowPrependText(" ")
, m_tableRowAppendText(" /")
, m_commentPrefix("--")
{
}
@@ -64,6 +65,14 @@ void RifEclipseDataTableFormatter::setTableRowLineAppendText(const QString& text
m_tableRowAppendText = text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::setCommentPrefix(const QString& commentPrefix)
{
m_commentPrefix = commentPrefix;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -71,7 +80,7 @@ void RifEclipseDataTableFormatter::outputBuffer()
{
if (!m_columns.empty() && !isAllHeadersEmpty(m_columns))
{
m_out << "-- ";
m_out << m_commentPrefix << " ";
for (RifEclipseOutputTableColumn& column : m_columns)
{
m_out << formatColumn(column.title, column);
@@ -110,7 +119,7 @@ void RifEclipseDataTableFormatter::outputBuffer()
//--------------------------------------------------------------------------------------------------
void RifEclipseDataTableFormatter::outputComment(RifEclipseOutputTableLine& comment)
{
m_out << "-- " << comment.data[0] << "\n";
m_out << m_commentPrefix << " " << comment.data[0] << "\n";
}
//--------------------------------------------------------------------------------------------------
@@ -135,7 +144,7 @@ void RifEclipseDataTableFormatter::outputHorizontalLine(RifEclipseOutputTableLin
QString str;
str.fill(fillChar, charCount);
m_out << "--" << str << "\n";
m_out << m_commentPrefix << str << "\n";
}
}