Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::text::html::TContainer Class Reference

#include <container.hh>

Inheritance diagram for mpcl::text::html::TContainer:

mpcl::text::html::TTag mpcl::text::html::TAnchor mpcl::text::html::TBasePage mpcl::text::html::TBody mpcl::text::html::TCheckboxGroup mpcl::text::html::TDivision mpcl::text::html::TForm mpcl::text::html::TFrameset mpcl::text::html::THead mpcl::text::html::TParagraph mpcl::text::html::TRadioGroup mpcl::text::html::TSelect mpcl::text::html::TSubmitGroup mpcl::text::html::TTable mpcl::text::html::TTableCell mpcl::text::html::TTableRow List of all members.

Public Types

typedef TMap< TString, QTTagTStringToTagMap
 Vector type with smart-pointers to tags.


Public Methods

void clear (void)
 Clears instance.

virtual QTTag findOrInsertTag (const TString &rkyIDENTIFIER)
void insertAs (const TString &rkyTAG_IDENTIFIER, const QTTag &rkqtTAG, iterator tINDEX)
virtual void insertUpdating (const QTTag &rkqtTAG)
virtual void insertUpdating (const QTTag &rkqtTAG, iterator tINDEX)
virtual void insert (const QTTag &rkqtTAG)
virtual void insert (const QTTag &rkqtTAG, iterator tINDEX)
void reset (void)
 Clears attribute "value".

void setClass (const TString &rkyCLASS, bool gDELEGATE=false)
void setClass (const char *pkcCLASS, bool gDELEGATE=false)
void setId (const char *pkcID, bool gDELEGATE=false)
void setId (const TString &rkyID, bool gDELEGATE=false)
void update (void)
iterator begin (void)
const_iterator begin (void) const
iterator end (void)
const_iterator end (void) const
virtual QTTag findTag (const TString &rkyIDENTIFIER) const
virtual bool hasTag (const TString &rkyIDENTIFIER) const
QTTag tag (const TString &rkyIDENTIFIER) const
const TTagoperator[] (const char *pkcIDENTIFIER) const
const TTagoperator[] (const TString &rkyIDENTIFIER) const
TTagoperator[] (const char *pkcIDENTIFIER)
TTagoperator[] (const TString &rkyIDENTIFIER)
size_type size (void) const

Protected Methods

void writeUsing (std::basic_ostream< char > &rtTARGET_OSTREAM, const TString &rkyQUALIFIED_IDENTIFIER) const

Protected Attributes

TTagList tTagList
 List with smart-pointers (to HTML tags).

TStringToTagMap tStringToTagMap

Detailed Description

HTML container base class.

When you insert an anonymous tag (without identifier), it is given a random identifier (for the container map, the tag identifier remains untouched). If you insert two times the same tag, it is given an extended identifier (for the container map only).

When a tag is inserted and its name is already in the container, then its name is mangled using character '_'.

Container instances that were trying to supplant another tag, must overload the next member functions:

operator[](), identifier(), value() and setValue().

Requirements: All tags contained have to be allocated with the new operator, because when the container is destroyed, all tags contained are deleted.

Definition at line 82 of file container.hh.


Member Function Documentation

mpcl::text::html::QTTag mpcl::text::html::TContainer::findOrInsertTag const TString   rkyIDENTIFIER [virtual]
 

Tries to find a tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class. If the tag is not found then it is inserted.

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented in mpcl::text::html::TLayoutTable, and mpcl::text::html::TTable.

Definition at line 35 of file container.cc.

References mpcl::text::Format(), insert(), mpcl::text::html::TTag::isDynamiclyLoadable(), mpcl::text::html::kcIdentifierSeparator, mpcl::text::html::QTTag, mpcl::text::TString, tStringToTagMap, and mpcl::text::html::TTag::TTag().

Referenced by mpcl::text::html::TTable::findOrInsertTag(), mpcl::text::html::TLayoutTable::findOrInsertTag(), and mpcl::text::html::TForm::setValues().

mpcl::text::html::QTTag mpcl::text::html::TContainer::findTag const TString   rkyIDENTIFIER const [virtual]
 

Tries to find a tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class.

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag or NULL if not.

Reimplemented in mpcl::text::html::TLayoutTable.

Definition at line 216 of file container.cc.

References mpcl::text::html::kcIdentifierSeparator, mpcl::text::html::QTTag, mpcl::text::TString, and tStringToTagMap.

Referenced by mpcl::text::html::TLayoutTable::findTag(), hasTag(), and tag().

virtual bool mpcl::text::html::TContainer::hasTag const TString   rkyIDENTIFIER const [inline, virtual]
 

Returns true if there is an tag named rkyIDENTIFIER between the tags stored (if any) in this instance, within first class.

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
True if there is that tag.

Definition at line 297 of file container.hh.

References findTag(), and mpcl::text::TString.

virtual void mpcl::text::html::TContainer::insert const QTTag   rkqtTAG,
iterator    tINDEX
[inline, virtual]
 

Inserts smart pointer rqtTAG into this container.

Parameters:
rqtTAG  Tag to be inserted.
tINDEX  Iterator pointing to the position where the tag rqtTAG must be inserted.

Definition at line 198 of file container.hh.

References insertUpdating(), mpcl::text::html::TTag::iterator, and mpcl::text::html::QTTag.

virtual void mpcl::text::html::TContainer::insert const QTTag   rkqtTAG [inline, virtual]
 

Inserts smart pointer rqtTAG into this container.

Parameters:
rqtTAG  Tag to be inserted.

Definition at line 187 of file container.hh.

References insertUpdating(), and mpcl::text::html::QTTag.

Referenced by mpcl::text::html::TTable::findOrInsertTag(), mpcl::text::html::TLayoutTable::findOrInsertTag(), findOrInsertTag(), mpcl::text::html::TAnchor::TAnchor(), mpcl::text::html::TPage::TPage(), and mpcl::text::html::TTableCell::TTableCell().

void mpcl::text::html::TContainer::insertAs const TString   rkyTAG_IDENTIFIER,
const QTTag   rkqtTAG,
iterator    tINDEX
 

Inserts the pointer rkqtTAG into this container, with name rkyTAG_IDENTIFIER.

Parameters:
rkyTAG_IDENTIFIER  Tag identifier.
rkqtTAG  Tag to be inserted.
tINDEX  Iterator pointing to the position where the tag rqtTAG must be inserted.

Definition at line 97 of file container.cc.

References mpcl::text::html::QTTag, mpcl::text::TString, tStringToTagMap, and tTagList.

Referenced by mpcl::text::html::TSubmitGroup::insertUpdating(), mpcl::text::html::TSelect::insertUpdating(), mpcl::text::html::TRadioGroup::insertUpdating(), mpcl::text::html::TImageSubmitGroup::insertUpdating(), insertUpdating(), and mpcl::text::html::TCheckboxGroup::insertUpdating().

virtual void mpcl::text::html::TContainer::insertUpdating const QTTag   rkqtTAG,
iterator    tINDEX
[inline, virtual]
 

Inserts the smart pointer rqtTAG into this container. This member method is used to update the source tag pointed by rqtTAG and then, to insert that tag into this container.

Parameters:
rqtTAG  Tag to be inserted.
tINDEX  Iterator pointing to the position where the tag rqtTAG must be inserted.

Reimplemented in mpcl::text::html::TCheckboxGroup, mpcl::text::html::TImageSubmitGroup, mpcl::text::html::TRadioGroup, mpcl::text::html::TSelect, and mpcl::text::html::TSubmitGroup.

Definition at line 178 of file container.hh.

References insertAs(), mpcl::text::html::TTag::iterator, and mpcl::text::html::QTTag.

virtual void mpcl::text::html::TContainer::insertUpdating const QTTag   rkqtTAG [inline, virtual]
 

Inserts the smart pointer rqtTAG into this container. This member method is used to update the source tag pointed by rqtTAG and then, to insert that tag into this container.

Parameters:
rqtTAG  Tag to be inserted.

Reimplemented in mpcl::text::html::TCheckboxGroup, mpcl::text::html::TImageSubmitGroup, mpcl::text::html::TRadioGroup, mpcl::text::html::TSelect, and mpcl::text::html::TSubmitGroup.

Definition at line 165 of file container.hh.

References insertAs(), and mpcl::text::html::QTTag.

Referenced by insert().

TTag& mpcl::text::html::TContainer::operator[] const TString   rkyIDENTIFIER [inline, virtual]
 

Gets the tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented from mpcl::text::html::TTag.

Definition at line 343 of file container.hh.

References tag(), and mpcl::text::TString.

TTag& mpcl::text::html::TContainer::operator[] const char *    pkcIDENTIFIER [inline, virtual]
 

Gets the tag named pkcIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
pkcIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented from mpcl::text::html::TTag.

Definition at line 332 of file container.hh.

References tag().

const TTag& mpcl::text::html::TContainer::operator[] const TString   rkyIDENTIFIER const [inline, virtual]
 

Gets the tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented from mpcl::text::html::TTag.

Definition at line 321 of file container.hh.

References tag(), and mpcl::text::TString.

const TTag& mpcl::text::html::TContainer::operator[] const char *    pkcIDENTIFIER const [inline, virtual]
 

Gets the tag named pkcIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
pkcIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented from mpcl::text::html::TTag.

Definition at line 310 of file container.hh.

References tag().

void mpcl::text::html::TContainer::setClass const char *    pkcCLASS,
bool    gDELEGATE = false
[virtual]
 

Sets CSS class.

Parameters:
pkcCLASS  CSS class name.
gDELEGATE  If true, the class of inner tags are also set to class pkcCLASS.

Reimplemented from mpcl::text::html::TTag.

Definition at line 193 of file container.cc.

References mpcl::text::html::TTag::iterator, and tTagList.

void mpcl::text::html::TContainer::setClass const TString   rkyCLASS,
bool    gDELEGATE = false
[virtual]
 

Sets CSS class.

Parameters:
rkyCLASS  CSS class name.
gDELEGATE  If true, the class of inner tags are also set to class rkyCLASS.

Reimplemented from mpcl::text::html::TTag.

Definition at line 174 of file container.cc.

References mpcl::text::html::TTag::iterator, mpcl::text::TString, and tTagList.

void mpcl::text::html::TContainer::setId const TString   rkyID,
bool    gDELEGATE = false
[virtual]
 

Assigns a value to the attribute "id" in the attribute map.

Parameters:
rkyID  New value of the attribute "id".
gDELEGATE  Make objects contained to have the same id.

Reimplemented from mpcl::text::html::TTag.

Definition at line 155 of file container.cc.

References mpcl::text::html::TTag::iterator, mpcl::text::TString, and tTagList.

void mpcl::text::html::TContainer::setId const char *    pkcID,
bool    gDELEGATE = false
[virtual]
 

Assigns a value to the attribute "id" in the attribute map.

Parameters:
pkcID  New value of the attribute "id".
gDELEGATE  Make objects contained to have the same id.

Reimplemented from mpcl::text::html::TTag.

Definition at line 136 of file container.cc.

References mpcl::text::html::TTag::iterator, and tTagList.

size_type mpcl::text::html::TContainer::size void    const [inline, virtual]
 

Gets the number of tags stored in this instance, within second class.

Warning:
Second class tags may be the same to first class tags.

Reimplemented from mpcl::text::html::TTag.

Definition at line 353 of file container.hh.

References mpcl::text::html::TTag::size_type, and tTagList.

mpcl::text::html::QTTag mpcl::text::html::TContainer::tag const TString   rkyIDENTIFIER const [virtual]
 

Gets the tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class.

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented from mpcl::text::html::TTag.

Definition at line 265 of file container.cc.

References findTag(), mpcl::text::Format(), mpcl::text::html::QTTag, and mpcl::text::TString.

Referenced by operator[]().

void mpcl::text::html::TContainer::update void    [inline, virtual]
 

Updates the object. This member function is used by HTML containers to update the value of the object, before writing the object onto a stream.

Reimplemented from mpcl::text::html::TTag.

Definition at line 245 of file container.hh.

References mpcl::text::html::TTag::iterator, and tTagList.

void mpcl::text::html::TContainer::writeUsing std::basic_ostream< char > &    rtTARGET_OSTREAM,
const TString   rkyQUALIFIED_IDENTIFIER
const [protected, virtual]
 

Writes on rtTARGET_OSTREAM this i nstance, using the identifier rkyQUALIFIED_IDENTIFIER plus qualified identifier.

Parameters:
rtTARGET_OSTREAM  Target stream.
rkyQUALIFIED_IDENTIFIER  Source qualified identifier.
See also:
qualifiedIdentifier().

Reimplemented from mpcl::text::html::TTag.

Reimplemented in mpcl::text::html::TPatternPage.

Definition at line 282 of file container.cc.

References mpcl::text::html::TTag::const_iterator, mpcl::text::html::TTag::gForwardIdentifier, mpcl::text::html::TTag::gIsQualified, mpcl::text::html::TTag::isVisible(), mpcl::text::html::kcIdentifierSeparator, mpcl::text::html::TTag::qualifiedIdentifier(), mpcl::text::html::TTag::tAttributeMap, mpcl::text::TString, mpcl::util::collection::TStringToStringMap, and tTagList.


Member Data Documentation

TStringToTagMap mpcl::text::html::TContainer::tStringToTagMap [protected]
 

Map with tag pseudo-identifiers to smart-pointers (to HTML tags). This class hasn't any order, but it must exist to enable random access.

Definition at line 103 of file container.hh.

Referenced by clear(), mpcl::text::html::TTable::findOrInsertTag(), mpcl::text::html::TLayoutTable::findOrInsertTag(), findOrInsertTag(), mpcl::text::html::TLayoutTable::findTag(), findTag(), insertAs(), and mpcl::text::html::TPatternPage::writeUsing().


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:35:26 2003 for MPCL by doxygen1.2.18