My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
TemplateBlockContext Class Reference

Class holding stacks of blocks available in the context. More...

Public Member Functions

 TemplateBlockContext ()
 
TemplateNodeBlockget (const QCString &name) const
 
TemplateNodeBlockpop (const QCString &name) const
 
void add (TemplateNodeBlock *block)
 
void add (TemplateBlockContext *ctx)
 
void push (TemplateNodeBlock *block)
 
void clear ()
 

Private Attributes

QDict< QList< TemplateNodeBlock > > m_blocks
 

Detailed Description

Class holding stacks of blocks available in the context.

Definition at line 487 of file template.cpp.

Constructor & Destructor Documentation

TemplateBlockContext::TemplateBlockContext ( )

Definition at line 4559 of file template.cpp.

References m_blocks.

: m_blocks(257)
{
m_blocks.setAutoDelete(TRUE);
}

Member Function Documentation

void TemplateBlockContext::add ( TemplateNodeBlock block)

Definition at line 4590 of file template.cpp.

References m_blocks, and TemplateNodeBlock::name().

Referenced by add(), TemplateImpl::render(), and TemplateNodeExtend::render().

{
QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
if (list==0)
{
list = new QList<TemplateNodeBlock>;
m_blocks.insert(block->name(),list);
}
list->prepend(block);
}
void TemplateBlockContext::add ( TemplateBlockContext ctx)

Definition at line 4601 of file template.cpp.

References add(), and m_blocks.

{
QDictIterator< QList<TemplateNodeBlock> > di(ctx->m_blocks);
QList<TemplateNodeBlock> *list;
for (di.toFirst();(list=di.current());++di)
{
QListIterator<TemplateNodeBlock> li(*list);
for (li.toFirst();(nb=li.current());++li)
{
add(nb);
}
}
}
void TemplateBlockContext::clear ( )

Definition at line 4616 of file template.cpp.

References m_blocks.

Referenced by TemplateNodeExtend::render().

{
m_blocks.clear();
}
TemplateNodeBlock * TemplateBlockContext::get ( const QCString &  name) const

Definition at line 4564 of file template.cpp.

References m_blocks.

Referenced by TemplateNodeBlock::render().

{
QList<TemplateNodeBlock> *list = m_blocks.find(name);
if (list==0 || list->count()==0)
{
return 0;
}
else
{
return list->getLast();
}
}
TemplateNodeBlock * TemplateBlockContext::pop ( const QCString &  name) const

Definition at line 4577 of file template.cpp.

References m_blocks.

Referenced by TemplateNodeBlock::render().

{
QList<TemplateNodeBlock> *list = m_blocks.find(name);
if (list==0 || list->count()==0)
{
return 0;
}
else
{
return list->take(list->count()-1);
}
}
void TemplateBlockContext::push ( TemplateNodeBlock block)

Definition at line 4621 of file template.cpp.

References m_blocks, and TemplateNodeBlock::name().

Referenced by TemplateNodeBlock::render().

{
QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
if (list==0)
{
list = new QList<TemplateNodeBlock>;
m_blocks.insert(block->name(),list);
}
list->append(block);
}

Member Data Documentation

QDict< QList<TemplateNodeBlock> > TemplateBlockContext::m_blocks
private

Definition at line 498 of file template.cpp.

Referenced by add(), clear(), get(), pop(), push(), and TemplateBlockContext().


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