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 486 of file template.cpp.

Constructor & Destructor Documentation

TemplateBlockContext::TemplateBlockContext ( )

Definition at line 4338 of file template.cpp.

4338  : m_blocks(257)
4339 {
4340  m_blocks.setAutoDelete(TRUE);
4341 }
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

void TemplateBlockContext::add ( TemplateNodeBlock block)

Definition at line 4369 of file template.cpp.

4370 {
4371  QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
4372  if (list==0)
4373  {
4374  list = new QList<TemplateNodeBlock>;
4375  m_blocks.insert(block->name(),list);
4376  }
4377  list->prepend(block);
4378 }
QCString name() const
Definition: template.cpp:3306
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
void prepend(const type *d)
Definition: qlist.h:72
Definition: qlist.h:54
void TemplateBlockContext::add ( TemplateBlockContext ctx)

Definition at line 4380 of file template.cpp.

4381 {
4382  QDictIterator< QList<TemplateNodeBlock> > di(ctx->m_blocks);
4384  for (di.toFirst();(list=di.current());++di)
4385  {
4388  for (li.toFirst();(nb=li.current());++li)
4389  {
4390  add(nb);
4391  }
4392  }
4393 }
static constexpr double nb
Definition: Units.h:81
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
Class representing a &#39;block&#39; tag in a template.
Definition: template.cpp:3241
void add(TemplateNodeBlock *block)
Definition: template.cpp:4369
Definition: qlist.h:54
void TemplateBlockContext::clear ( )

Definition at line 4395 of file template.cpp.

4396 {
4397  m_blocks.clear();
4398 }
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
TemplateNodeBlock * TemplateBlockContext::get ( const QCString name) const

Definition at line 4343 of file template.cpp.

4344 {
4345  QList<TemplateNodeBlock> *list = m_blocks.find(name);
4346  if (list==0 || list->count()==0)
4347  {
4348  return 0;
4349  }
4350  else
4351  {
4352  return list->getLast();
4353  }
4354 }
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
uint count() const
Definition: qlist.h:66
type * getLast() const
Definition: qlist.h:96
Definition: qlist.h:54
TemplateNodeBlock * TemplateBlockContext::pop ( const QCString name) const

Definition at line 4356 of file template.cpp.

4357 {
4358  QList<TemplateNodeBlock> *list = m_blocks.find(name);
4359  if (list==0 || list->count()==0)
4360  {
4361  return 0;
4362  }
4363  else
4364  {
4365  return list->take(list->count()-1);
4366  }
4367 }
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
uint count() const
Definition: qlist.h:66
type * take(uint i)
Definition: qlist.h:81
Definition: qlist.h:54
void TemplateBlockContext::push ( TemplateNodeBlock block)

Definition at line 4400 of file template.cpp.

4401 {
4402  QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
4403  if (list==0)
4404  {
4405  list = new QList<TemplateNodeBlock>;
4406  m_blocks.insert(block->name(),list);
4407  }
4408  list->append(block);
4409 }
void append(const type *d)
Definition: qlist.h:73
QCString name() const
Definition: template.cpp:3306
QDict< QList< TemplateNodeBlock > > m_blocks
Definition: template.cpp:497
Definition: qlist.h:54

Member Data Documentation

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

Definition at line 497 of file template.cpp.


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