#include <cgicc/HTMLElement.h>
Inheritance diagram for cgicc::HTMLElement:
Public Types | |
enum | EElementType { eAtomic, eBoolean } |
Possible types of HTMLElements. More... | |
Public Member Functions | |
virtual HTMLElement * | clone () const=0 |
Clone this HTMLElement. | |
virtual void | render (std::ostream &out) const |
Render this HTMLElement to an ostream. | |
Constructors and Destructor | |
HTMLElement (const HTMLElement &element) | |
Copy constructor. | |
virtual | ~HTMLElement () |
Destructor. | |
Overloaded Operators | |
bool | operator== (const HTMLElement &element) const |
Compare two HTMLElements for equality. | |
bool | operator!= (const HTMLElement &element) const |
Compare two HTMLElements for inequality. | |
HTMLElement & | operator= (const HTMLElement &element) |
Assignment operator. | |
Accessor Methods | |
Information on the element | |
virtual const char * | getName () const=0 |
Get the name of this element. | |
std::string | getData () const |
Get the data contained in this element, if any. | |
EElementType | getType () const |
Get the type of this element. | |
Mutator Methods | |
Set properties of the element | |
void | setData (const std::string &data) |
Set the data contained in this element. | |
Embedded HTMLElement Management | |
Manage elements embedded in this one | |
const HTMLElementList * | getEmbedded () const |
Get the HTMLElementList embedded in this element, if any. | |
void | setEmbedded (const HTMLElementList &embedded) |
Set the HTMLElementList associated with this element. | |
HTMLElement & | add (const HTMLElement &element) |
Add an embedded HTMLElement in this one. | |
HTMLElement & | add (HTMLElement *element) |
Add an embedded HTMLElement in this one. | |
HTMLAttribute Management | |
Manage attributes embedded in this element | |
const HTMLAttributeList * | getAttributes () const |
Get the attributes associated with this element. | |
void | setAttributes (const HTMLAttributeList &attributes) |
Set the attributes associated with this element. | |
HTMLElement & | set (const std::string &name) |
Set an HTMLAttribute on this HTMLElement. | |
HTMLElement & | set (const std::string &name, const std::string &value) |
Set an HTMLAttribute on this HTMLElement. | |
Boolean element methods | |
Methods specific to boolean elements | |
virtual void | swapState () const |
Swap the state of the boolean element. | |
virtual bool | getState () const |
Get the state of this boolean element. | |
Protected Member Functions | |
HTMLElement (const HTMLAttributeList *attributes, const HTMLElement *embedded, const std::string *data, EElementType type) | |
Subclass constructor. | |
bool | dataSpecified () const |
For subclasses only. |
An HTML element is any entity enclosed in angle brackets (< and >) interpreted as HTML, for example a
, img
, html
, and body
.
This class is an abstract base class that defines the interface for all HTMLElement subclasses.
Definition at line 58 of file HTMLElement.h.
|
Possible types of HTMLElements.
An HTMLElement is either atomic, meaning it has no corresponding closing tag (elements such as Definition at line 69 of file HTMLElement.h. |
|
Copy constructor.
Sets the name and internal state of this element to those of
|
|
Destructor. Delete this HTMLElement object |
|
Subclass constructor. This allows the subclasses to fully specify all properties
|
|
Add an embedded HTMLElement in this one.
This element takes ownership of
|
|
Add an embedded HTMLElement in this one.
|
|
Clone this HTMLElement. This performs a deep copy of the element
Implemented in cgicc::HTMLAtomicElement< Tag >, cgicc::HTMLBooleanElement< Tag >, and cgicc::HTMLBooleanElement< nullTag >. |
|
For subclasses only.
Returns
Definition at line 365 of file HTMLElement.h. |
|
Get the attributes associated with this element. If this method returns 0, no attributes are embedded
Definition at line 269 of file HTMLElement.h. |
|
Get the data contained in this element, if any. This is only applicable for boolean elements
Definition at line 164 of file HTMLElement.h. |
|
Get the HTMLElementList embedded in this element, if any. If this method returns 0, no elements are embedded
Definition at line 221 of file HTMLElement.h. |
|
Get the name of this element.
For example,
Implemented in cgicc::HTMLAtomicElement< Tag >, cgicc::HTMLBooleanElement< Tag >, and cgicc::HTMLBooleanElement< nullTag >. |
|
Get the state of this boolean element.
Reimplemented in cgicc::HTMLBooleanElement< Tag >, and cgicc::HTMLBooleanElement< nullTag >. Definition at line 328 of file HTMLElement.h. |
|
Get the type of this element. Most HTMLElements are boolean
Definition at line 174 of file HTMLElement.h. |
|
Compare two HTMLElements for inequality. HTMLElements are equal if they have the same name
Definition at line 120 of file HTMLElement.h. |
|
Assignment operator.
Sets the name and internal state of this element to those of
|
|
Compare two HTMLElements for equality. HTMLElements are equal if they have the same name
|
|
Render this HTMLElement to an ostream. This is used for output
Implements cgicc::MStreamable. |
|
Set an HTMLAttribute on this HTMLElement.
|
|
Set an HTMLAttribute on this HTMLElement.
|
|
Set the attributes associated with this element. This is usually called by subclass constructors
|
|
Set the data contained in this element. The data is the text contained between the opening and closing tags
Definition at line 192 of file HTMLElement.h. |
|
Set the HTMLElementList associated with this element. This is usually called by subclass constructors
|
|
Swap the state of the boolean element.
A state of Reimplemented in cgicc::HTMLBooleanElement< Tag >, and cgicc::HTMLBooleanElement< nullTag >. Definition at line 318 of file HTMLElement.h. |