wxhtmltagthis class represents a single html tag. it is used by tag handlers. derived from wxobject include files <wx/html/htmltag.h> members
wxhtmltag::wxhtmltag
wxhtmltag::wxhtmltagwxhtmltag(wxhtmltag *parent, const wxstring& source, int pos, int end_pos, wxhtmltagscache* cache, wxhtmlentitiesparser *entparser) constructor. you will probably never have to construct a wxhtmltag object yourself. feel free to ignore the constructor parameters. have a look at src/html/htmlpars.cpp if you're interested in creating it.
wxhtmltag::getallparamsconst wxstring& getallparams() const returns a string containing all parameters. example : tag contains <font size=+2 color="#000000">. call to tag.getallparams() would return size=+2 color="#000000".
wxhtmltag::getbeginposint getbeginpos() const returns beginning position of the text between this tag and paired ending tag. see explanation (returned position is marked with '|'):
bla bla bla <mytag> bla bla internal text</mytag> bla bla | wxhtmltag::getendpos1int getendpos1() const returns ending position of the text between this tag and paired ending tag. see explanation (returned position is marked with '|'):
bla bla bla <mytag> bla bla internal text</mytag> bla bla | wxhtmltag::getendpos2int getendpos2() const returns ending position 2 of the text between this tag and paired ending tag. see explanation (returned position is marked with '|'):
bla bla bla <mytag> bla bla internal text</mytag> bla bla | wxhtmltag::getnamewxstring getname() const returns tag's name. the name is always in uppercase and it doesn't contain '<' or '/' characters. (so the name of <font size=+2> tag is "font" and name of </table> is "table")
wxhtmltag::getparamwxstring getparam(const wxstring& par, bool with_commas = false) const returns the value of the parameter. you should check whether the parameter exists or not (use hasparam) first. parameters par
with_commas
example
... /* you have wxhtmltag variable tag which is equal to html tag <font size=+2 color="#0000ff"> */ dummy = tag.getparam("size"); // dummy == "+2" dummy = tag.getparam("color"); // dummy == "#0000ff" dummy = tag.getparam("color", true); // dummy == "\"#0000ff\"" -- see the difference!! wxhtmltag::getparamascolourbool getparamascolour(const wxstring& par, wxcolour *clr) const interprets tag parameter par as colour specification and saves its value into wxcolour variable pointed by clr. returns true on success and false if par is not colour specification or if the tag has no such parameter.
wxhtmltag::getparamasintbool getparamasint(const wxstring& par, int *value) const interprets tag parameter par as an integer and saves its value into int variable pointed by value. returns true on success and false if par is not an integer or if the tag has no such parameter.
wxhtmltag::hasendingbool hasending() const returns true if this tag is paired with ending tag, false otherwise. see the example of html document:
<html><body> hello<p> how are you? <p align=center>this is centered...</p> oops<br>oooops! </body></html>in this example tags html and body have ending tags, first p and br doesn't have ending tag while the second p has. the third p tag (which is ending itself) of course doesn't have ending tag.
wxhtmltag::hasparambool hasparam(const wxstring& par) const returns true if the tag has a parameter of the given name. example : <font size=+2 color="#ff00ff"> has two parameters named "size" and "color". parameters par
wxhtmltag::scanparamwxstring scanparam(const wxstring& par, const wxchar *format, void *value) const this method scans the given parameter. usage is exactly the same as sscanf's usage except that you don't pass a string but a parameter name as the first argument and you can only retrieve one value (i.e. you can use only one "%" element in format). parameters par
format
value
|