Doxygen
TemplateImpl类 参考

Internal class representing the implementation of a template 更多...

+ 类 TemplateImpl 继承关系图:
+ TemplateImpl 的协作图:

Public 成员函数

 TemplateImpl (TemplateEngine *e, const QCString &name, const QCString &data, const QCString &extension)
 
 ~TemplateImpl ()
 
void render (TextStream &ts, TemplateContext *c)
 
TemplateEngineengine () const
 
TemplateBlockContextblockContext ()
 
- Public 成员函数 继承自 TemplateNode
 TemplateNode (TemplateNode *parent)
 
virtual ~TemplateNode ()
 
TemplateNodeparent ()
 
- Public 成员函数 继承自 Template
virtual ~Template ()
 Destructor 更多...
 

Private 属性

TemplateEnginem_engine = 0
 
QCString m_name
 
TemplateNodeList m_nodes
 
TemplateBlockContext m_blockContext
 

详细描述

Internal class representing the implementation of a template

在文件 template.cpp2554 行定义.

构造及析构函数说明

◆ TemplateImpl()

TemplateImpl::TemplateImpl ( TemplateEngine e,
const QCString name,
const QCString data,
const QCString extension 
)

在文件 template.cpp5177 行定义.

5179  : TemplateNode(0)
5180 {
5181  //printf("%p:TemplateImpl::TemplateImpl(%s)\n",(void*)this,qPrint(name));
5182  m_name = name;
5183  m_engine = engine;
5184  TemplateLexer lexer(engine,name,data);
5185  if (extension=="tex")
5186  {
5187  lexer.setOpenCloseCharacters('<','>');
5188  }
5189  TemplateTokenStream tokens;
5190  lexer.tokenize(tokens);
5191  TemplateParser parser(engine,name,tokens);
5192  parser.parse(this,1,StringVector(),m_nodes);
5193 }

引用了 engine(), m_engine, m_name, m_nodes, TemplateParser::parse(), TemplateLexer::setOpenCloseCharacters() , 以及 TemplateLexer::tokenize().

◆ ~TemplateImpl()

TemplateImpl::~TemplateImpl ( )

在文件 template.cpp5195 行定义.

5196 {
5197  //printf("%p:TemplateImpl::~TemplateImpl(%s)\n",(void*)this,qPrint(m_name));
5198 }

成员函数说明

◆ blockContext()

TemplateBlockContext* TemplateImpl::blockContext ( )
inline

在文件 template.cpp2563 行定义.

2563 { return &m_blockContext; }

引用了 m_blockContext.

◆ engine()

TemplateEngine* TemplateImpl::engine ( ) const
inline

◆ render()

void TemplateImpl::render ( TextStream ts,
TemplateContext c 
)
virtual

实现了 TemplateNode.

在文件 template.cpp5200 行定义.

5201 {
5202  TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
5203  if (ci==0) return; // should not happen
5204  if (!m_nodes.empty())
5205  {
5206  TemplateNodeExtend *ne = dynamic_cast<TemplateNodeExtend*>(m_nodes.front().get());
5207  if (ne==0) // normal template, add blocks to block context
5208  {
5209  TemplateBlockContext *bc = ci->blockContext();
5210  for (const auto &n : m_nodes)
5211  {
5212  TemplateNodeBlock *nb = dynamic_cast<TemplateNodeBlock*>(n.get());
5213  if (nb)
5214  {
5215  bc->add(nb);
5216  }
5217  }
5218  }
5219  m_nodes.render(ts,c);
5220  }
5221 }

引用了 TemplateBlockContext::add(), TemplateContextImpl::blockContext(), m_nodes , 以及 TemplateNodeList::render().

被这些函数引用 TemplateNodeExtend::render(), TemplateNodeInclude::render() , 以及 TemplateNodeCreate::render().

类成员变量说明

◆ m_blockContext

TemplateBlockContext TemplateImpl::m_blockContext
private

在文件 template.cpp2569 行定义.

被这些函数引用 blockContext().

◆ m_engine

TemplateEngine* TemplateImpl::m_engine = 0
private

在文件 template.cpp2566 行定义.

被这些函数引用 engine() , 以及 TemplateImpl().

◆ m_name

QCString TemplateImpl::m_name
private

在文件 template.cpp2567 行定义.

被这些函数引用 TemplateImpl().

◆ m_nodes

TemplateNodeList TemplateImpl::m_nodes
private

在文件 template.cpp2568 行定义.

被这些函数引用 render() , 以及 TemplateImpl().


该类的文档由以下文件生成:
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
Rtf_Style_Default::name
const char * name
Definition: rtfstyle.h:40
TemplateTokenStream
std::deque< TemplateTokenPtr > TemplateTokenStream
Definition: template.cpp:1963
TemplateImpl::m_engine
TemplateEngine * m_engine
Definition: template.cpp:2566
TemplateParser
Parser for templates
Definition: template.cpp:1985
TemplateNodeBlock
Class representing a 'block' tag in a template
Definition: template.cpp:3600
TemplateImpl::engine
TemplateEngine * engine() const
Definition: template.cpp:2562
TemplateLexer
Lexer class for turning a template into a list of tokens
Definition: template.cpp:4805
TemplateBlockContext
Class holding stacks of blocks available in the context
Definition: template.cpp:614
TemplateNodeList::render
void render(TextStream &ts, TemplateContext *c)
Definition: template.cpp:1971
TemplateBlockContext::add
void add(TemplateNodeBlock *block)
Definition: template.cpp:4765
TemplateNode::TemplateNode
TemplateNode(TemplateNode *parent)
Definition: template.cpp:1936
TemplateImpl::m_blockContext
TemplateBlockContext m_blockContext
Definition: template.cpp:2569
TemplateNodeExtend
Class representing a 'extend' tag in a template
Definition: template.cpp:3677
TemplateImpl::m_name
QCString m_name
Definition: template.cpp:2567
TemplateContextImpl
Internal class representing the implementation of a template context
Definition: template.cpp:640
TemplateContextImpl::blockContext
TemplateBlockContext * blockContext()
Definition: template.cpp:2768
TemplateImpl::m_nodes
TemplateNodeList m_nodes
Definition: template.cpp:2568