#2225 Well formations: Handle tabs in well path formations reader

This commit is contained in:
Rebecca Cox committed 2017-12-06 08:19:42 +01:00
1 parent 8e3f02879c
commit bef764bf5b
1 file changed
+14 -2
@@ -23,6 +23,10 @@
#include <QFile>
#include <QStringList>
#include <algorithm>
#include <string>
#include <cctype>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -50,6 +54,14 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
return result;
}
void removeWhiteSpaces(QString* word)
{
std::string wordStd = word->toStdString();
wordStd.erase(std::remove_if(wordStd.begin(), wordStd.end(), [](unsigned char x) {return std::isspace(x); }), wordStd.end());
(*word) = QString(wordStd.c_str());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -67,9 +79,9 @@ void RifWellPathFormationReader::readFileIntoMap(const QString&
while (header.size() < 3)
{
QString line = data.readLine().toLower();
QString lineWithoutSpaces = line.remove(' ');
removeWhiteSpaces(&line);
header = lineWithoutSpaces.split(';', QString::KeepEmptyParts);
header = line.split(';', QString::KeepEmptyParts);
}
const QString wellNameText = "wellname";