MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / WizHTMLGetBodyTextWithoutBodyTag

Function WizHTMLGetBodyTextWithoutBodyTag

src/WizCombineNotesDialog.cpp:301–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299
300
301BOOL WizHTMLGetBodyTextWithoutBodyTag(QString lpszText, CString& strRet)
302{
303 int pBegin = WizStrStrI_Pos(lpszText, _T("<body"));
304 if (pBegin != -1)
305 {
306 pBegin = WizStrStrI_Pos(lpszText, _T(">"), pBegin);
307 if (pBegin)
308 pBegin++;
309 }
310 else
311 {
312 pBegin = WizStrStrI_Pos(lpszText, _T("<html"));
313 //
314 if (pBegin != -1)
315 {
316 pBegin = WizStrStrI_Pos(lpszText, _T(">"), pBegin);
317 if (pBegin)
318 pBegin++;
319 }
320 else
321 {
322 pBegin = 0;
323 }
324 }
325 //could not find char '>', _tcschr failed
326 if (pBegin == -1)
327 pBegin = 0;
328 //
329 int pEnd = WizStrRStrI_Pos(lpszText, _T("</body"));
330 if (pEnd == -1)
331 pEnd = WizStrRStrI_Pos(lpszText, _T("</html"));
332 if (pEnd == -1)
333 pEnd = lpszText.length();
334 //
335 strRet = lpszText.mid(pBegin, pEnd - pBegin);
336 //
337 return TRUE;
338}
339
340BOOL WizCombineHtmlText(CString& strTextTo, QString lpszTextFrom)
341{

Callers 1

WizCombineHtmlTextFunction · 0.85

Calls 3

WizStrStrI_PosFunction · 0.85
WizStrRStrI_PosFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected