diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2013-01-07 08:03:21 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2013-01-07 08:03:21 +0000 |
commit | 97f7345a5f6acccd2fbbf0a23f0ac70d9f7785f7 (patch) | |
tree | 3083dfa7039bf0b59a0089746b02a0f3b502e2b7 /plugins/New_GPG/src | |
parent | 34b3fb960faed1bf0866a25f0aad890bcdf4718d (diff) |
using boost for string cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@3005 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src')
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index f8ad62e31f..11e53b091f 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1877,30 +1877,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)
|