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

Class representing a piece of plain text in a template. More...

Inheritance diagram for TemplateNodeText:
TemplateNode

Public Member Functions

 TemplateNodeText (TemplateParser *, TemplateNode *parent, int, const QCString &data)
 
void render (FTextStream &ts, TemplateContext *c)
 
- Public Member Functions inherited from TemplateNode
 TemplateNode (TemplateNode *parent)
 
virtual ~TemplateNode ()
 
TemplateNodeparent ()
 

Private Attributes

QCString m_data
 

Detailed Description

Class representing a piece of plain text in a template.

Definition at line 2690 of file template.cpp.

Constructor & Destructor Documentation

TemplateNodeText::TemplateNodeText ( TemplateParser ,
TemplateNode parent,
int  ,
const QCString &  data 
)
inline

Definition at line 2693 of file template.cpp.

References TRACE.

: TemplateNode(parent), m_data(data)
{
TRACE(("TemplateNodeText('%s')\n",replace(data,'\n',' ').data()));
}

Member Function Documentation

void TemplateNodeText::render ( FTextStream ts,
TemplateContext c 
)
inlinevirtual

Implements TemplateNode.

Definition at line 2699 of file template.cpp.

References m_data, TemplateContextImpl::needsRecoding(), TemplateContextImpl::recode(), TemplateSpacelessIntf::remove(), TemplateContextImpl::spacelessEnabled(), and TemplateContextImpl::spacelessIntf().

{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
//printf("TemplateNodeText::render(%s) needsRecoding=%d ci=%p\n",m_data.data(),ci->needsRecoding(),ci);
if (ci->spacelessEnabled())
{
if (ci->needsRecoding())
{
ts << ci->recode(ci->spacelessIntf()->remove(m_data));
}
else
{
ts << ci->spacelessIntf()->remove(m_data);
}
}
else
{
if (ci->needsRecoding())
{
ts << ci->recode(m_data);
}
else
{
ts << m_data;
}
}
}

Member Data Documentation

QCString TemplateNodeText::m_data
private

Definition at line 2728 of file template.cpp.

Referenced by render().


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