From d0fefcaeec1f2c9aad122bbdb97506d0acb9995f Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Sun, 30 Dec 2012 03:51:49 +0000 Subject: fixed bug with tag stripping git-svn-id: http://svn.miranda-ng.org/main/trunk@2890 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/utilities.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'plugins/New_GPG/src/utilities.cpp') diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 36bd5a5ec1..af1e942cc8 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1890,3 +1890,28 @@ void strip_line_term(std::string &s) for(std::string::size_type i = s.find("\n"); i != std::string::npos; i = s.find("\n", i+1)) s.erase(i, 1); } + +void strip_tags(std::wstring &str) +{ + std::wstring::size_type p; + if(_tcslen(inopentag)) + { + for(p = str.find(inopentag); p != std::wstring::npos; p = str.find(inopentag)) + str.erase(p, _tcslen(inopentag)); + } + if(_tcslen(inclosetag)) + { + for(p = str.find(inclosetag); p != std::wstring::npos; p = str.find(inclosetag)) + str.erase(p, _tcslen(inclosetag)); + } + if(_tcslen(outopentag)) + { + for(p = str.find(outopentag); p != std::wstring::npos; p = str.find(outopentag)) + str.erase(p, _tcslen(outopentag)); + } + if(_tcslen(outclosetag)) + { + for(p = str.find(outclosetag); p != std::wstring::npos; p = str.find(outclosetag)) + str.erase(p, _tcslen(outclosetag)); + } +} \ No newline at end of file -- cgit v1.2.3