MQTTSuite
Loading...
Searching...
No Matches
inja::Template Struct Reference

The main inja Template. More...

#include <inja.hpp>

Collaboration diagram for inja::Template:

Public Member Functions

 Template ()
 Template (const std::string &content)
unsigned int count_variables ()
 Return number of variables (total number, not distinct ones) in the template.

Public Attributes

BlockNode root
std::string content
std::map< std::string, std::shared_ptr< BlockStatementNode > > block_storage

Detailed Description

The main inja Template.

Definition at line 886 of file inja.hpp.

Constructor & Destructor Documentation

◆ Template() [1/2]

inja::Template::Template ( )
inlineexplicit

Definition at line 891 of file inja.hpp.

891 {
892 }

◆ Template() [2/2]

inja::Template::Template ( const std::string & content)
inlineexplicit

Definition at line 893 of file inja.hpp.

894 : content(content) {
895 }
std::string content
Definition inja.hpp:888

References content.

Referenced by inja::Parser::add_to_template_storage(), inja::Parser::parse(), and inja::Environment::parse_template().

Here is the caller graph for this function:

Member Function Documentation

◆ count_variables()

unsigned int inja::Template::count_variables ( )
inline

Return number of variables (total number, not distinct ones) in the template.

Definition at line 898 of file inja.hpp.

898 {
899 auto statistic_visitor = StatisticsVisitor();
900 root.accept(statistic_visitor);
901 return statistic_visitor.variable_counter;
902 }
BlockNode root
Definition inja.hpp:887

References inja::BlockNode::accept(), root, inja::StatisticsVisitor::StatisticsVisitor(), and inja::StatisticsVisitor::variable_counter.

Here is the call graph for this function:

Member Data Documentation

◆ block_storage

std::map<std::string, std::shared_ptr<BlockStatementNode> > inja::Template::block_storage

◆ content

◆ root

BlockNode inja::Template::root

Definition at line 887 of file inja.hpp.

Referenced by count_variables(), inja::Parser::parse_into(), and inja::Renderer::render_to().


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