If the data in the configuration file requires translation, you have to translate it. Short of regular expressions (which are clearly overkill for this), I don't know of any standard function which would do this. We use something like:
std::string
globalReplace(
std::string::const_iterator begin,
std::string::const_iterator end,
std::string const& before,
std::string const& after )
{
std::string retval;
std::back_insert_iterator<std::string> dest( retval );
std::string::const_iterator current = begin;
std::string::const_iterator next
= std::search( current, end, before.begin(), before.end() );
while ( next != end ) {
std::copy( current, next, dest );
std::copy( after.begin(), after.end(), dest );
current = next + before.size();
next = std::search( current, end, before.begin(), before.end() );
}
std::copy( current, next, dest );
return retval;
}
for this. You could call it with "\\r\\n", "\r\n"
for the
last to arguments, for example.