Crow  1.0
A C++ microframework for the web
crow::mustache::template_t Class Reference

A mustache template object. More...

Collaboration diagram for crow::mustache::template_t:

Public Member Functions

 template_t (std::string body)
 
rendered_template render () const
 Output a returnable template from this mustache template. More...
 
rendered_template render (context &ctx) const
 Apply the values from the context provided and output a returnable template from this mustache template. More...
 
std::string render_string () const
 Output a returnable template from this mustache template. More...
 
std::string render_string (context &ctx) const
 Apply the values from the context provided and output a returnable template from this mustache template. More...
 

Private Member Functions

std::string tag_name (const Action &action) const
 
auto find_context (const std::string &name, const std::vector< context * > &stack, bool shouldUseOnlyFirstStackValue=false) const -> std::pair< bool, context & >
 
void escape (const std::string &in, std::string &out) const
 
bool isTagInsideObjectBlock (const int &current, const std::vector< context * > &stack) const
 
void render_internal (int actionBegin, int actionEnd, std::vector< context * > &stack, std::string &out, int indent) const
 
void render_fragment (const std::pair< int, int > fragment, int indent, std::string &out) const
 
void parse ()
 

Private Attributes

std::vector< std::pair< int, int > > fragments_
 
std::vector< Actionactions_
 
std::string body_
 

Detailed Description

A mustache template object.

Constructor & Destructor Documentation

◆ template_t()

crow::mustache::template_t::template_t ( std::string  body)
inline
Here is the call graph for this function:

Member Function Documentation

◆ tag_name()

std::string crow::mustache::template_t::tag_name ( const Action action) const
inlineprivate
Here is the caller graph for this function:

◆ find_context()

auto crow::mustache::template_t::find_context ( const std::string &  name,
const std::vector< context * > &  stack,
bool  shouldUseOnlyFirstStackValue = false 
) const -> std::pair<bool, context&>
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ escape()

void crow::mustache::template_t::escape ( const std::string &  in,
std::string &  out 
) const
inlineprivate
Here is the caller graph for this function:

◆ isTagInsideObjectBlock()

bool crow::mustache::template_t::isTagInsideObjectBlock ( const int &  current,
const std::vector< context * > &  stack 
) const
inlineprivate
Here is the caller graph for this function:

◆ render_internal()

void crow::mustache::template_t::render_internal ( int  actionBegin,
int  actionEnd,
std::vector< context * > &  stack,
std::string &  out,
int  indent 
) const
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_fragment()

void crow::mustache::template_t::render_fragment ( const std::pair< int, int >  fragment,
int  indent,
std::string &  out 
) const
inlineprivate
Here is the caller graph for this function:

◆ render() [1/2]

rendered_template crow::mustache::template_t::render ( ) const
inline

Output a returnable template from this mustache template.

Here is the call graph for this function:

◆ render() [2/2]

rendered_template crow::mustache::template_t::render ( context ctx) const
inline

Apply the values from the context provided and output a returnable template from this mustache template.

Here is the call graph for this function:

◆ render_string() [1/2]

std::string crow::mustache::template_t::render_string ( ) const
inline

Output a returnable template from this mustache template.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_string() [2/2]

std::string crow::mustache::template_t::render_string ( context ctx) const
inline

Apply the values from the context provided and output a returnable template from this mustache template.

Here is the call graph for this function:

◆ parse()

void crow::mustache::template_t::parse ( )
inlineprivate
Here is the caller graph for this function:

Member Data Documentation

◆ fragments_

std::vector<std::pair<int, int> > crow::mustache::template_t::fragments_
private

◆ actions_

std::vector<Action> crow::mustache::template_t::actions_
private

◆ body_

std::string crow::mustache::template_t::body_
private

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