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 (std::string content)
size_t count_variables () const
 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 912 of file inja.hpp.

Constructor & Destructor Documentation

◆ Template() [1/2]

inja::Template::Template ( )
inlineexplicit

Definition at line 917 of file inja.hpp.

917 {
918 }

◆ Template() [2/2]

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

Definition at line 919 of file inja.hpp.

920 : content(std::move(content)) {
921 }
std::string content
Definition inja.hpp:914

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()

size_t inja::Template::count_variables ( ) const
inline

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

Definition at line 924 of file inja.hpp.

924 {
925 auto statistic_visitor = StatisticsVisitor();
926 root.accept(statistic_visitor);
927 return statistic_visitor.variable_counter;
928 }
BlockNode root
Definition inja.hpp:913

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 913 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: