Crossfire Server, Trunk
|
Class for rendering a Template with data. More...
#include <inja.hpp>
Public Member Functions | |
void | render_to (std::ostream &os, const Template &tmpl, const json &data, json *loop_data=nullptr) |
Renderer (const RenderConfig &config, const TemplateStorage &template_storage, const FunctionStorage &function_storage) | |
Public Member Functions inherited from inja::NodeVisitor | |
virtual | ~NodeVisitor ()=default |
Private Types | |
using | Op = FunctionStorage::Operation |
Private Member Functions | |
const std::shared_ptr< json > | eval_expression_list (const ExpressionListNode &expression_list) |
template<bool throw_not_found = true> | |
Arguments | get_argument_vector (const FunctionNode &node) |
template<size_t N, size_t N_start = 0, bool throw_not_found = true> | |
std::array< const json *, N > | get_arguments (const FunctionNode &node) |
void | print_json (const std::shared_ptr< json > value) |
void | throw_renderer_error (const std::string &message, const AstNode &node) |
bool | truthy (const json *data) const |
void | visit (const BlockNode &node) |
void | visit (const BlockStatementNode &node) |
void | visit (const ExpressionListNode &node) |
void | visit (const ExpressionNode &) |
void | visit (const ExtendsStatementNode &node) |
void | visit (const ForArrayStatementNode &node) |
void | visit (const ForObjectStatementNode &node) |
void | visit (const ForStatementNode &) |
void | visit (const FunctionNode &node) |
void | visit (const IfStatementNode &node) |
void | visit (const IncludeStatementNode &node) |
void | visit (const JsonNode &node) |
void | visit (const LiteralNode &node) |
void | visit (const SetStatementNode &node) |
void | visit (const StatementNode &) |
void | visit (const TextNode &node) |
Private Attributes | |
std::vector< const BlockStatementNode * > | block_statement_stack |
bool | break_rendering {false} |
const RenderConfig | config |
size_t | current_level {0} |
json * | current_loop_data = &json_additional_data["loop"] |
const Template * | current_template |
const FunctionStorage & | function_storage |
json | json_additional_data |
std::stack< const json * > | json_eval_stack |
const json * | json_input |
std::vector< std::shared_ptr< json > > | json_tmp_stack |
std::stack< const JsonNode * > | not_found_stack |
std::ostream * | output_stream |
std::vector< const Template * > | template_stack |
const TemplateStorage & | template_storage |
|
private |
|
inline |
|
inlineprivate |
Definition at line 3565 of file inja.hpp.
References rotate-tower::result, and inja::ExpressionListNode::root.
|
inlineprivate |
Definition at line 3631 of file inja.hpp.
References disinfect::a, inja::FunctionNode::arguments, rotate-tower::result, and nonstd::sv_lite::to_string().
|
inlineprivate |
Definition at line 3600 of file inja.hpp.
References inja::FunctionNode::arguments, rotate-tower::result, and nonstd::sv_lite::to_string().
|
inlineprivate |
|
inline |
Definition at line 4195 of file inja.hpp.
References inja::BlockNode::accept(), navar-midane_time::data, nlohmann::basic_json::emplace_back(), and inja::Template::root.
Referenced by inja::Environment::render_to().
|
inlineprivate |
Definition at line 3594 of file inja.hpp.
References inja::Template::content, inja::get_source_location(), INJA_THROW, diamondslots::message, and inja::AstNode::pos.
|
inlineprivate |
Definition at line 3543 of file inja.hpp.
References navar-midane_time::data.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 3658 of file inja.hpp.
References inja::BlockNode::nodes.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4170 of file inja.hpp.
References inja::Template::block_storage, inja::BlockStatementNode::name, and sword_of_souls::old_level.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4159 of file inja.hpp.
References inja::ExtendsStatementNode::file, and inja::render_to().
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4062 of file inja.hpp.
References inja::BlockNode::accept(), inja::ForStatementNode::body, inja::ForStatementNode::condition, empty, nlohmann::basic_json::empty(), npc_dialog::index, rotate-tower::result, Ice::tmp, and inja::ForArrayStatementNode::value.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4101 of file inja.hpp.
References inja::BlockNode::accept(), inja::ForStatementNode::body, inja::ForStatementNode::condition, empty, nlohmann::basic_json::empty(), npc_dialog::index, inja::ForObjectStatementNode::key, rotate-tower::result, inja::ForObjectStatementNode::value, and nlohmann::basic_json::value().
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 3701 of file inja.hpp.
References make_face_from_files::args, inja::FunctionNode::arguments, inja::Template::block_storage, inja::FunctionNode::callback, nlohmann::basic_json::contains(), nlohmann::detail::get(), sword_of_souls::Int, level, give::name, None, sword_of_souls::old_level, inja::FunctionNode::operation, rotate-tower::result, nonstd::sv_lite::to_string(), and tolower.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4140 of file inja.hpp.
References inja::BlockNode::accept(), inja::IfStatementNode::condition, inja::IfStatementNode::false_statement, inja::IfStatementNode::has_false_statement, rotate-tower::result, and inja::IfStatementNode::true_statement.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4149 of file inja.hpp.
References inja::IncludeStatementNode::file.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 3678 of file inja.hpp.
References nlohmann::basic_json::contains(), inja::FunctionStorage::find_function(), inja::JsonNode::name, and inja::JsonNode::ptr.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 3674 of file inja.hpp.
References inja::LiteralNode::value.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 4184 of file inja.hpp.
References inja::SetStatementNode::expression, inja::SetStatementNode::key, and inja::replace_substring().
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
|
inlineprivatevirtual |
Implements inja::NodeVisitor.
Definition at line 3668 of file inja.hpp.
References inja::Template::content, inja::TextNode::length, and inja::AstNode::pos.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |