|
| | FakeElement (const xml::XMLQualifiedNameRef &tagName="unknown") |
| | Construct a fake element with the given tag name.
|
| DeferredPrinter | printAsTree () const |
| | When used in an ostream output stream, prints the element's and all children instead of just the element.
|
|
bool | operator< (const FakeElement &other) const |
| | Comparison operator, uses pointer comparison for simplicity.
|
|
bool | operator== (const FakeElement &other) const |
| | Equality operator.
|
|
xml::XMLQualifiedNameRef | tagName () const |
| | Get the XML tag name string for this element.
|
|
bool | isKnownType () const |
| | Returns true if this is a known element type. For FakeElement, returns false for "unknown" elements.
|
|
RcString | id () const |
| | Gets the element id, the value of the "id" attribute.
|
|
RcString | className () const |
| | Gets the element class name, the value of the "class" attribute.
|
| std::optional< RcString > | getAttribute (const xml::XMLQualifiedNameRef &name) const |
| | Get the value of an attribute, if it exists.
|
| SmallVector< xml::XMLQualifiedNameRef, 1 > | findMatchingAttributes (const xml::XMLQualifiedNameRef &matcher) const |
| | Find attributes matching the given name matcher.
|
| std::optional< FakeElement > | parentElement () const |
| | Get this element's parent, if it exists.
|
| std::optional< FakeElement > | firstChild () const |
| | Get the first child of this element, if it exists.
|
| std::optional< FakeElement > | lastChild () const |
| | Get the last child of this element, if it exists.
|
| std::optional< FakeElement > | previousSibling () const |
| | Get the previous sibling of this element, if it exists.
|
| std::optional< FakeElement > | nextSibling () const |
| | Get the next sibling of this element, if it exists.
|
|
void | setId (const RcString &id) |
| | Sets the element id, the value of the "id" attribute.
|
|
void | setClassName (const RcString &className) |
| | Sets the element class name, the value of the "class" attribute.
|
|
void | setAttribute (const xml::XMLQualifiedNameRef &name, const RcString &value) |
| | Sets the value of an attribute.
|
|
void | appendChild (const FakeElement &child) |
| | Appends a new child to this element's child list.
|
A test fake for a type that satisfies the ElementLike concept.
This is used for testing purposes, and has simple implementations for each API.
- Examples
- custom_css_parser.cc.