#2003 Observed Data : Add basic support for fixed width in parser

This commit is contained in:
Magne Sjaastad committed 2017-11-03 17:42:16 +01:00
1 parent 50b2717ed2
commit f50760bb35
4 files changed
+43 -42

No files matched your search

@@ -66,14 +66,28 @@ const ColumnInfo* RifColumnBasedUserDataParser::columnInfo(size_t tableIndex, si
//--------------------------------------------------------------------------------------------------
void RifColumnBasedUserDataParser::parseTableData(const QString& data)
{
std::string stdData = data.toStdString();
bool isFixedWidth = RifEclipseUserDataParserTools::isFixedWidthHeader(stdData);
std::stringstream streamData;
streamData.str(data.toStdString());
streamData.str(stdData);
do
{
std::vector<std::string> errorStrings;
auto table = RifEclipseUserDataParserTools::tableDataFromText(streamData, &errorStrings);
TableData table;
if (isFixedWidth)
{
auto columnInfos = RifEclipseUserDataParserTools::columnInfoForFixedColumnWidth(streamData);
table = TableData("", "", "", columnInfos);
}
else
{
table = RifEclipseUserDataParserTools::tableDataFromText(streamData, &errorStrings);
}
if (m_errorText)
{
for (auto s : errorStrings)