Skip to content
Snippets Groups Projects
Commit 78a3f0ed authored by Franck Dary's avatar Franck Dary
Browse files

replacing all newline and tab in rawInput with spaces

parent a21ec725
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ class utf8string : public std::vector<utf8char> ...@@ -29,6 +29,7 @@ class utf8string : public std::vector<utf8char>
utf8string & operator=(const std::string & other); utf8string & operator=(const std::string & other);
utf8string & operator=(const char * const other); utf8string & operator=(const char * const other);
bool operator==(const std::string & other); bool operator==(const std::string & other);
void replace(utf8char from, utf8char to);
}; };
}; };
......
...@@ -70,3 +70,8 @@ bool util::utf8string::operator==(const std::string & other) ...@@ -70,3 +70,8 @@ bool util::utf8string::operator==(const std::string & other)
return true; return true;
} }
void util::utf8string::replace(utf8char from, utf8char to)
{
std::replace(begin(), end(), from, to);
}
...@@ -49,6 +49,8 @@ void BaseConfig::readRawInput(std::string_view rawFilename) ...@@ -49,6 +49,8 @@ void BaseConfig::readRawInput(std::string_view rawFilename)
std::fclose(file); std::fclose(file);
rawInputUtf8 = util::splitAsUtf8(rawInputTemp); rawInputUtf8 = util::splitAsUtf8(rawInputTemp);
rawInputUtf8.replace(util::utf8char("\n"), util::utf8char(" "));
rawInputUtf8.replace(util::utf8char("\t"), util::utf8char(" "));
} }
void BaseConfig::readTSVInput(std::string_view tsvFilename) void BaseConfig::readTSVInput(std::string_view tsvFilename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment