diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-01-09 15:27:34 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-01-09 15:27:34 +0200 |
commit | 1d5d5d5ef65687785382346d483f88c75548d46b (patch) | |
tree | 4505a837bd3f421cd5558b74f7e9afec1477d0ce /src/utilities.cpp | |
parent | 29dc7fef90e299bb9abebbdbd6a96430ecfdad25 (diff) |
merged with miranda_ng main repo
Diffstat (limited to 'src/utilities.cpp')
-rwxr-xr-x | src/utilities.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/utilities.cpp b/src/utilities.cpp index 2cca6ff..e208c4a 100755 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -1926,30 +1926,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)
|