From e2c7efa04b89b1d911106960af005a9ede672063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 9 Nov 2002 19:30:02 +0000 Subject: [PATCH] added wxHtmlParser::StopParsing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/htparser.tex | 8 ++++++++ include/wx/html/htmlpars.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/docs/latex/wx/htparser.tex b/docs/latex/wx/htparser.tex index f198bb9887..c9595b05e6 100644 --- a/docs/latex/wx/htparser.tex +++ b/docs/latex/wx/htparser.tex @@ -256,3 +256,11 @@ Sets the virtual file system that will be used to request additional files. (For example {\tt } tag handler requests wxFSFile with the image data.) +\membersection{wxHtmlParser::StopParsing}\label{wxhtmlparserstopparsing} + +\func{void}{StopParsing}{\void} + +Call this function to interrupt parsing from a tag handler. No more tags +will be parsed afterward. This function may only be called from +\helpref{wxHtmlParser::Parse}{wxhtmlparserparse} or any function called +by it (i.e. from tag handlers). diff --git a/include/wx/html/htmlpars.h b/include/wx/html/htmlpars.h index 4ddc3fda66..58f2f2bcc0 100644 --- a/include/wx/html/htmlpars.h +++ b/include/wx/html/htmlpars.h @@ -72,6 +72,9 @@ public: virtual void InitParser(const wxString& source); // This must be called after Parse(). virtual void DoneParser(); + + // May be called during parsing to immediately return from Parse(). + virtual void StopParsing() { m_stopParsing = TRUE; } // Parses the m_Source from begin_pos to end_pos-1. // (in noparams version it parses whole m_Source) @@ -178,6 +181,9 @@ protected: // entity parse wxHtmlEntitiesParser *m_entitiesParser; + + // flag indicating that the parser should stop + bool m_stopParsing; };