matador::http::template_engine Class Reference

#include <template_engine.hpp>

Static Public Member Functions

template<class T >
static std::string render (const std::string &format, const T &data)
 
template<typename T >
static std::string render (const std::string &format, const object_ptr< T > &data)
 
static std::string render (const std::string &format, const matador::json &data)
 
static std::string render (const char *format, size_t len, const matador::json &data)
 
static std::string render (const std::shared_ptr< detail::template_part > &part, const matador::json &data)
 
static std::shared_ptr< detail::template_part > build (const std::string &format)
 

Detailed Description

This class provides static methods to render data (json, structure or object pointer) into a given format string

Member Function Documentation

◆ render() [1/4]

static std::string matador::http::template_engine::render ( const char *  format,
size_t  len,
const matador::json data 
)
static

Render the given format string with the given json data object.

Parameters
formatFormat string to render.
lenLength of the format string.
dataJson data object to be rendered in.
Returns
The rendered string

◆ render() [2/4]

static std::string matador::http::template_engine::render ( const std::string &  format,
const matador::json data 
)
static

Render the given format string with the given json data object.

Parameters
formatFormat string to render.
dataJson data object to be rendered in.
Returns
The rendered string

◆ render() [3/4]

template<typename T >
std::string matador::http::template_engine::render ( const std::string &  format,
const object_ptr< T > &  data 
)
static

Render the format string with the given object pointer.

Template Parameters
TType of object pointer.
Parameters
formatFormat string to render.
dataData object to be rendered in.
Returns
The rendered string

◆ render() [4/4]

template<class T >
std::string matador::http::template_engine::render ( const std::string &  format,
const T &  data 
)
static

Render the given format string with the given data object.

Template Parameters
TType of data object.
Parameters
formatFormat string to render.
dataData object to be rendered in.
Returns
The rendered string

The documentation for this class was generated from the following file:
  • matador/http/template_engine.hpp