Matches HTML nodes for which every given Match returns false.
More...
#include <NegateMatch.h>
Matches HTML nodes for which every given Match returns false.
- Example:
GumboNode * attr_none = ...;
GumboNode * attr_one = ...;
GumboNode * attr_two = ...;
NegateMatch not_one (std::make_unique<AttributeCountMatch>(1));
NegateMatch not_none(std::make_unique<AttributeCountMatch>(0));
assert(!not_none.matches(attr_none));
assert( not_none.matches(attr_one));
assert( not_none.matches(attr_two));
assert( not_one.matches(attr_none));
assert(!not_one.matches(attr_one));
assert( not_one.matches(attr_two));
Matches HTML nodes for which every given Match returns false.
Definition at line 53 of file NegateMatch.h.
◆ NegateMatch() [1/4]
hext::NegateMatch::NegateMatch |
( |
std::vector< std::unique_ptr< Match > > |
v_matches = {} | ) |
|
|
explicitnoexcept |
Constructs a NegateMatch that matches nodes for which every contained Match returns false.
- Parameters
-
v_matches | An optional vector containing Matches. |
◆ NegateMatch() [2/4]
hext::NegateMatch::NegateMatch |
( |
std::unique_ptr< Match > |
match | ) |
|
|
explicit |
◆ ~NegateMatch()
hext::NegateMatch::~NegateMatch |
( |
| ) |
|
|
overridedefaultnoexcept |
◆ NegateMatch() [3/4]
◆ NegateMatch() [4/4]
hext::NegateMatch::NegateMatch |
( |
const NegateMatch & |
other | ) |
|
◆ append_match()
void hext::NegateMatch::append_match |
( |
std::unique_ptr< Match > |
match | ) |
|
Appends a Match.
- Parameters
-
match | The Match to append. |
◆ matches()
bool hext::NegateMatch::matches |
( |
const GumboNode * |
node | ) |
const |
|
overridevirtual |
Returns true if every contained Match returns false for node.
- Parameters
-
node | A pointer to a GumboNode. |
Implements hext::Match.
◆ operator=() [1/2]
◆ operator=() [2/2]
The documentation for this class was generated from the following file: