QHtmlParser
0.0.1
A Qt/C++ library for parsing and traversing/searching HTML documents.
|
Defines the criteria used for performing a match against the attributes of an element. More...
#include <qhtmlparser.h>
Public Member Functions | |
QHtmlAttributeMatch () | |
Constructs a QHtmlAttributeMatch with an empty name and value. | |
QHtmlAttributeMatch (const QString &name, const QString &value, QHtmlParser::MatchFlags flags=QHtmlParser::MatchFlags(QHtmlParser::MatchExactly)) | |
Constructs a QHtmlAttributeMatch using the specified name, value and flags. | |
QHtmlParser::MatchFlags | flags () const |
Returns the flags set for the attribute match. More... | |
void | setFlags (QHtmlParser::MatchFlags flags) |
Sets the flags for the attribute match to flags. More... | |
void | setFlag (QHtmlParser::MatchFlag flag, bool on=true) |
Sets or unsets the flag depending of the value of on (default is true ). More... | |
bool | testFlag (QHtmlParser::MatchFlag flag) const |
Returns true if flag is set. More... | |
bool | operator== (const QHtmlAttributeMatch &other) const |
Returns true if name(), value() and flags() of other are equal to those of this QHtmlAttributeMatch. | |
bool | operator!= (const QHtmlAttributeMatch &other) const |
Returns true if either name(), value() or flags() of other are not equal to those of this QHtmlAttributeMatch. | |
![]() | |
QHtmlAttribute () | |
Constructs a QHtmlAttribute with an empty name and value. | |
QHtmlAttribute (const QString &name, const QString &value) | |
Constructs a QHtmlAttribute using the specified name and value. | |
const QString & | name () const |
Returns the name of the attribute. | |
void | setName (const QString &name) |
Sets the name of the attribute to name. | |
const QString & | value () const |
Returns the value of the attribute. | |
void | setValue (const QString &value) |
Sets the value of the attribute to value. | |
bool | operator== (const QHtmlAttribute &other) const |
Returns true if both name() and value() of other are equal to those of this QHtmlAttribute. | |
bool | operator!= (const QHtmlAttribute &other) const |
Returns true if either name() or value() of other are not equal to those of this QHtmlAttribute. | |
Defines the criteria used for performing a match against the attributes of an element.
The QHtmlAttributeMatch class is used to define the criteria that is applied when performing a match against the attributes of a QHtmlElement.
A match is performed by looking for any attribute of the QHtmlElement that has the same name as the QHtmlAttributeMatch, and a value that matches the criteria defined by value() and flags(). The value may be a string or regular expression pattern. The manner in which the value is matched against attributes is determined by the flags, which may be a bitwise OR combination of the QHtmlParser::MatchFlag enum values.
Example usage:
QHtmlParser::MatchFlags QHtmlAttributeMatch::flags | ( | ) | const |
Returns the flags set for the attribute match.
void QHtmlAttributeMatch::setFlags | ( | QHtmlParser::MatchFlags | flags | ) |
Sets the flags for the attribute match to flags.
void QHtmlAttributeMatch::setFlag | ( | QHtmlParser::MatchFlag | flag, |
bool | on = true |
||
) |
Sets or unsets the flag depending of the value of on (default is true
).
bool QHtmlAttributeMatch::testFlag | ( | QHtmlParser::MatchFlag | flag | ) | const |
Returns true
if flag is set.