summaryrefslogtreecommitdiff
path: root/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-01-09 15:29:45 +0200
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-01-09 15:29:45 +0200
commit4a8d2270c087aef94fbd0b7d19df6dec05441edf (patch)
tree2a9f11724e9e679cdcc740c903b3beb6f65d0bff /utilities.cpp
parent0ca37041442b35763a3761aad47965a2c119f932 (diff)
merged with miranda_ng main repo
Diffstat (limited to 'utilities.cpp')
-rwxr-xr-xutilities.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/utilities.cpp b/utilities.cpp
index 2bf86af..d23853f 100755
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -1928,30 +1928,24 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
void fix_line_term(std::string &s)
{
- for(std::string::size_type s1 = s.find("\r\r", 0); s1 != string::npos; s1 = s.find("\r\r", s1))
- s.erase(s1, 1);
+ boost::algorithm::erase_all(s, "\r\r");
}
void fix_line_term(std::wstring &s)
{
- for(std::wstring::size_type s1 = s.find(_T("\r\r"), 0); s1 != wstring::npos; s1 = s.find(_T("\r\r"), s1))
- s.erase(s1, 1);
+ boost::algorithm::erase_all(s, _T("\r\r"));
}
void strip_line_term(std::wstring &s)
{
- for(std::wstring::size_type i = s.find(_T("\r")); i != std::wstring::npos; i = s.find(_T("\r"), i+1))
- s.erase(i, 1);
- for(std::wstring::size_type i = s.find(_T("\n")); i != std::wstring::npos; i = s.find(_T("\n"), i+1))
- s.erase(i, 1);
+ boost::algorithm::erase_all(s, _T("\r"));
+ boost::algorithm::erase_all(s, _T("\n"));
}
void strip_line_term(std::string &s)
{
- for(std::string::size_type i = s.find("\r"); i != std::string::npos; i = s.find("\r", i+1))
- s.erase(i, 1);
- for(std::string::size_type i = s.find("\n"); i != std::string::npos; i = s.find("\n", i+1))
- s.erase(i, 1);
+ boost::algorithm::erase_all(s, "\r");
+ boost::algorithm::erase_all(s, "\n");
}
void strip_tags(std::wstring &str)