Selector which match the element's id attribute, for example #foo matches an element with an id="foo" attribute.
More...
#include "donner/css/selectors/IdSelector.h"
|
| | IdSelector (const RcString &name) |
| | Create an IdSelector with the given name.
|
|
| ~IdSelector () noexcept=default |
| | Destructor.
|
|
| IdSelector (IdSelector &&)=default |
| | Move constructor.
|
|
IdSelector & | operator= (IdSelector &&)=default |
| | Move assignment operator.
|
|
| IdSelector (const IdSelector &)=default |
| | Copy constructor.
|
|
IdSelector & | operator= (const IdSelector &)=default |
| | Copy assignment operator.
|
|
bool | isValid () const |
| | Returns true if this is a valid selector.
|
| template<ElementLike T> |
| bool | matches (const T &element) const |
| | Returns true if the provided element matches this selector, based on a case-sensitive match of the provided id against the element's id attribute.
|
|
|
RcString | name |
| | The id to match, without the leading #.
|
|
|
std::ostream & | operator<< (std::ostream &os, const IdSelector &obj) |
| | Ostream output operator, outputs a debug string e.g. IdSelector(foo).
|
Selector which match the element's id attribute, for example #foo matches an element with an id="foo" attribute.
See https://www.w3.org/TR/selectors-4/#id-selectors for the full definition.
◆ IdSelector()
| donner::css::IdSelector::IdSelector |
( |
const RcString & | name | ) |
|
|
inlineexplicit |
Create an IdSelector with the given name.
- Parameters
-
| name | The id to match, without the leading #. |
◆ matches()
template<ElementLike T>
| bool donner::css::IdSelector::matches |
( |
const T & | element | ) |
const |
|
inline |
Returns true if the provided element matches this selector, based on a case-sensitive match of the provided id against the element's id attribute.
- Parameters
-
| element | The element to check. |
The documentation for this struct was generated from the following file: