mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3464 Well Path Export. Add support for setting custom comment prefix in formatter
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ public:
|
||||
void setColumnSpacing(int spacing);
|
||||
void setTableRowPrependText(const QString& text);
|
||||
void setTableRowLineAppendText(const QString& text);
|
||||
void setCommentPrefix(const QString& commentPrefix);
|
||||
|
||||
RifEclipseDataTableFormatter& keyword(const QString& keyword);
|
||||
RifEclipseDataTableFormatter& header(std::vector<RifEclipseOutputTableColumn> tableHeader);
|
||||
@@ -156,4 +157,5 @@ private:
|
||||
int m_colSpacing;
|
||||
QString m_tableRowPrependText;
|
||||
QString m_tableRowAppendText;
|
||||
QString m_commentPrefix;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user