void string_switch(std::string &strBig, const std::string strsrc, const std::string strdst)
{
std::string::size_type pos = 0;
std::string::size_type srclen = strsrc.size();
std::string::size_type dstlen = strdst.size();
std::string tp = ":";
std::string::size_type tplen = tp.size();
while ((pos = strBig.find(strsrc, pos)) != std::string::npos)
{
strBig.replace(pos, srclen, tp);
++pos;
}
pos = 0;
while ((pos = strBig.find(strdst, pos)) != std::string::npos)
{
strBig.replace(pos, dstlen, strsrc);
++pos;
}
pos = 0;
while ((pos = strBig.find(tp, pos)) != std::string::npos)
{
strBig.replace(pos, tplen, strdst);
++pos;
}
}