List of all members
cgicc::HTMLBooleanElement< Tag > Class Template Reference

Template for concrete boolean HTMLElement subclasses. More...

#include <cgicc/HTMLBooleanElement.h>

Inheritance diagram for cgicc::HTMLBooleanElement< Tag >:
cgicc::HTMLElement cgicc::MStreamable

Public Member Functions

Constructors and Destructor
 HTMLBooleanElement ()
 Create a new empty boolean element.
 
 HTMLBooleanElement (const std::string &text)
 Create a new element, specifying the enclosed text.
 
 HTMLBooleanElement (const HTMLAttributeList &attributes)
 Create a new element, specifying the HTMLAttribute objects.
 
 HTMLBooleanElement (const HTMLElement &embedded)
 Create a new element, specifying an embedded HTMLElement.
 
 HTMLBooleanElement (const std::string &text, const HTMLAttributeList &attributes)
 Create a new element, specifying the enclosed text and HTMLAttribute objects.
 
 HTMLBooleanElement (const HTMLAttributeList &attributes, const HTMLElement &embed)
 Create a new element, specifying the HTMLAttributes and embedded HTMLElement.
 
virtual ~HTMLBooleanElement ()
 Destructor.
 
virtual HTMLElementclone () const
 Clone this element.
 
virtual const char * getName () const
 Get the name of this element. For example, "strong".
 
- Public Member Functions inherited from cgicc::HTMLElement
 HTMLElement (const HTMLElement &element)
 Copy constructor.
 
virtual ~HTMLElement ()
 Destructor.
 
bool operator== (const HTMLElement &element) const
 Compare two HTMLElements for equality.
 
bool operator!= (const HTMLElement &element) const
 Compare two HTMLElements for inequality.
 
HTMLElementoperator= (const HTMLElement &element)
 Assignment operator.
 
std::string getData () const
 Get the data contained in this element, if any.
 
EElementType getType () const
 Get the type of this element.
 
void setData (const std::string &data)
 Set the data contained in this element.
 
const HTMLElementListgetEmbedded () const
 Get the HTMLElementList embedded in this element, if any.
 
void setEmbedded (const HTMLElementList &embedded)
 Set the HTMLElementList associated with this element.
 
HTMLElementadd (const HTMLElement &element)
 Add an embedded HTMLElement in this one.
 
HTMLElementadd (HTMLElement *element)
 Add an embedded HTMLElement in this one.
 
const HTMLAttributeListgetAttributes () const
 Get the attributes associated with this element.
 
void setAttributes (const HTMLAttributeList &attributes)
 Set the attributes associated with this element.
 
HTMLElementset (const std::string &name)
 Set an HTMLAttribute on this HTMLElement.
 
HTMLElementset (const std::string &name, const std::string &value)
 Set an HTMLAttribute on this HTMLElement.
 
virtual void render (std::ostream &out) const
 Render this HTMLElement to an ostream.
 
- Public Member Functions inherited from cgicc::MStreamable
 MStreamable ()
 Empty constructor.
 
virtual ~MStreamable ()
 Empty destructor.
 
virtual void render (std::ostream &out) const =0
 Write this object to a stream.

 

State Management

virtual void swapState () const
 Swap the state of this boolean element.
 
virtual bool getState () const
 Get the state of this boolean element.
 
static void reset ()
 Reset the state of this boolean element to closed.
 

Additional Inherited Members

- Public Types inherited from cgicc::HTMLElement
enum  EElementType { eAtomic , eBoolean }
 Possible types of HTMLElements. More...
 
- Protected Member Functions inherited from cgicc::HTMLElement
 HTMLElement (const HTMLAttributeList *attributes, const HTMLElement *embedded, const std::string *data, EElementType type)
 Subclass constructor.
 
bool dataSpecified () const
 For subclasses only.
 

Detailed Description

template<class Tag>
class cgicc::HTMLBooleanElement< Tag >

Template for concrete boolean HTMLElement subclasses.

A boolean HTML element is an element having a boolean (open or closed) state. Most commonly used HTML tags are boolean elements:

<a href="http://www.gnu.org">GNU Project</a>

The a element is boolean, since it is either open or closed. Boolean elements are often additive:

<b>bold text<i>bold italic text</i></b>

Note than under the XHTML 1.0 standard, elements may not overlap; ie, in the example above, it would be illegal to close the b tag before the i tag.

See also
HTMLElement
HTMLAtomicElement

Definition at line 62 of file HTMLBooleanElement.h.

Constructor & Destructor Documentation

◆ HTMLBooleanElement() [1/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( )
inline

Create a new empty boolean element.

Definition at line 75 of file HTMLBooleanElement.h.

◆ HTMLBooleanElement() [2/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( const std::string &  text)
inline

Create a new element, specifying the enclosed text.

Parameters
textThe text within the element.

Definition at line 83 of file HTMLBooleanElement.h.

◆ HTMLBooleanElement() [3/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( const HTMLAttributeList attributes)
inline

Create a new element, specifying the HTMLAttribute objects.

Parameters
attributesThe HTMLAttributes contained within the element.

Definition at line 91 of file HTMLBooleanElement.h.

◆ HTMLBooleanElement() [4/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( const HTMLElement embedded)
inline

Create a new element, specifying an embedded HTMLElement.

Parameters
embeddedThe HTMLElement embedded inside the element.

Definition at line 99 of file HTMLBooleanElement.h.

◆ HTMLBooleanElement() [5/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( const std::string &  text,
const HTMLAttributeList attributes 
)
inline

Create a new element, specifying the enclosed text and HTMLAttribute objects.

Parameters
attributesThe HTMLAttributes contained within the element.
textThe text within the element.

Definition at line 109 of file HTMLBooleanElement.h.

◆ HTMLBooleanElement() [6/6]

template<class Tag >
cgicc::HTMLBooleanElement< Tag >::HTMLBooleanElement ( const HTMLAttributeList attributes,
const HTMLElement embed 
)
inline

Create a new element, specifying the HTMLAttributes and embedded HTMLElement.

Parameters
attributesThe HTMLAttributes contained within the element.
embedThe HTMLElement embedded inside the element.

Definition at line 120 of file HTMLBooleanElement.h.

◆ ~HTMLBooleanElement()

template<class Tag >
virtual cgicc::HTMLBooleanElement< Tag >::~HTMLBooleanElement ( )
inlinevirtual

Destructor.

Definition at line 129 of file HTMLBooleanElement.h.

Member Function Documentation

◆ clone()

template<class Tag >
virtual HTMLElement * cgicc::HTMLBooleanElement< Tag >::clone ( ) const
inlinevirtual

Clone this element.

Returns
A newly-allocated copy of this element

Implements cgicc::HTMLElement.

Definition at line 140 of file HTMLBooleanElement.h.

◆ getName()

template<class Tag >
virtual const char * cgicc::HTMLBooleanElement< Tag >::getName ( ) const
inlinevirtual

Get the name of this element. For example, "strong".

Returns
The name of this element

Implements cgicc::HTMLElement.

Definition at line 150 of file HTMLBooleanElement.h.

◆ getState()

template<class Tag >
virtual bool cgicc::HTMLBooleanElement< Tag >::getState ( ) const
inlinevirtual

Get the state of this boolean element.

Returns
true if this element is open, false otherwise

Reimplemented from cgicc::HTMLElement.

Definition at line 172 of file HTMLBooleanElement.h.

◆ reset()

template<class Tag >
static void cgicc::HTMLBooleanElement< Tag >::reset ( )
inlinestatic

Reset the state of this boolean element to closed.

Definition at line 180 of file HTMLBooleanElement.h.

◆ swapState()

template<class Tag >
virtual void cgicc::HTMLBooleanElement< Tag >::swapState ( ) const
inlinevirtual

Swap the state of this boolean element.

A state of true indicates the element is currently open

Reimplemented from cgicc::HTMLElement.

Definition at line 164 of file HTMLBooleanElement.h.


The documentation for this class was generated from the following file:

GNU cgicc - A C++ class library for writing CGI applications
Copyright © 1996 - 2004 Stephen F. Booth
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.
Documentation generated Fri Mar 1 2024 08:39:42 for cgicc by doxygen 1.9.6