KiCad PCB EDA Suite
LINK_TAGHANDLER Class Reference

a Tag parser, to extract tagged data in html text. More...

#include <html_link_parser.h>

Inheritance diagram for LINK_TAGHANDLER:

Public Member Functions

 LINK_TAGHANDLER ()
 
 LINK_TAGHANDLER (HTML_LINK_PARSER *aParser)
 
wxString GetSupportedTags () override
 
bool HandleTag (const wxHtmlTag &tag) override
 

Private Attributes

HTML_LINK_PARSERm_Parser
 

Detailed Description

a Tag parser, to extract tagged data in html text.

this tag handler extract a url link, givent by tag "A" like: "<a href="/KiCad/Valves.pretty" itemprop="name codeRepository"> Valves.pretty</a>" the tag is "a" and the link is the parameter given by "href"

Definition at line 50 of file html_link_parser.h.

Constructor & Destructor Documentation

LINK_TAGHANDLER::LINK_TAGHANDLER ( )
inline

Definition at line 55 of file html_link_parser.h.

55  : m_Parser( NULL )
56  {
57  }
LINK_TAGHANDLER::LINK_TAGHANDLER ( HTML_LINK_PARSER aParser)
inline

Definition at line 59 of file html_link_parser.h.

59  : m_Parser( aParser )
60  {
61  }

Member Function Documentation

wxString LINK_TAGHANDLER::GetSupportedTags ( )
inlineoverride

Definition at line 63 of file html_link_parser.h.

64  {
65  return "A";
66  }
bool LINK_TAGHANDLER::HandleTag ( const wxHtmlTag &  tag)
override

Definition at line 35 of file html_link_parser.cpp.

References HTML_LINK_PARSER::AddString(), and m_Parser.

36 {
37  if( tag.HasParam( wxT("HREF") ) )
38  {
39  wxString href( tag.GetParam( wxT("HREF") ) );
40  // Add the first parameter (the link)
41  m_Parser->AddString( href );
42  // Parse other params, but do nothing, because the AddText() callback
43  // do nothing
44  ParseInner(tag);
45  return true;
46  }
47  else
48  return false;
49 }

Member Data Documentation

HTML_LINK_PARSER* LINK_TAGHANDLER::m_Parser
private

Definition at line 52 of file html_link_parser.h.

Referenced by HandleTag().


The documentation for this class was generated from the following files: