You can remove the '\r' from the end using this code:
if(line[line.length() - 1] == '\r') line = line.substr(0, line.length() - 1);
You can wrap this into a function if you want to:
std::istream& univGetline(std::istream& stream, std::string& line)
{
std::getline(stream, line);
if(line[line.length() - 1] == '\r') line = line.substr(0, line.length() - 1);
return stream;
}
Integrated into your function:
void process (std::string str)
{
std::istringstream istream(str);
std::string line;
std::string specialStr("; -------- Special --------------------");
while (univGetline(istream,line))
{
if (strcmp(specialStr.c_str(), line.c_str()) != 0)
{
continue;
}
else
{
//special processing
}
}
}