Crossfire Server, Trunk
inja Namespace Reference

Namespaces

 string_view
 

Data Structures

class  AstNode
 Base node class for the abstract syntax tree (AST). More...
 
class  BlockNode
 
class  BlockStatementNode
 
class  Environment
 Class for changing the configuration. More...
 
class  ExpressionListNode
 
class  ExpressionNode
 
class  ExtendsStatementNode
 
struct  FileError
 
class  ForArrayStatementNode
 
class  ForObjectStatementNode
 
class  ForStatementNode
 
class  FunctionNode
 
class  FunctionStorage
 Class for builtin functions and user-defined callbacks. More...
 
class  IfStatementNode
 
class  IncludeStatementNode
 
struct  InjaError
 
struct  JsonError
 
class  JsonNode
 
class  Lexer
 Class for lexing an inja Template. More...
 
class  LiteralNode
 
class  NodeVisitor
 
class  Parser
 Class for parsing an inja Template. More...
 
struct  ParserError
 
class  Renderer
 Class for rendering a Template with data. More...
 
struct  RenderError
 
class  SetStatementNode
 
struct  SourceLocation
 
class  StatementNode
 
class  StatisticsVisitor
 A class for counting statistics on a Template. More...
 
struct  Template
 The main inja Template. More...
 
class  TextNode
 
struct  Token
 Helper-class for the inja Lexer. More...
 

Typedefs

using Arguments = std::vector< const json * >
 
using CallbackFunction = std::function< json(Arguments &args)>
 
using json = nlohmann::json
 
using TemplateStorage = std::map< std::string, Template >
 
using VoidCallbackFunction = std::function< void(Arguments &args)>
 

Functions

SourceLocation get_source_location (nonstd::string_view content, size_t pos)
 
void open_file_or_throw (const std::string &path, std::ifstream &file)
 
std::string render (nonstd::string_view input, const json &data)
 render with default settings to a string More...
 
void render_to (std::ostream &os, nonstd::string_view input, const json &data)
 render with default settings to the given output stream More...
 
void replace_substring (std::string &s, const std::string &f, const std::string &t)
 

Typedef Documentation

◆ Arguments

using inja::Arguments = typedef std::vector<const json *>

Definition at line 1567 of file inja.hpp.

◆ CallbackFunction

using inja::CallbackFunction = typedef std::function<json(Arguments &args)>

Definition at line 1568 of file inja.hpp.

◆ json

Definition at line 1565 of file inja.hpp.

◆ TemplateStorage

using inja::TemplateStorage = typedef std::map<std::string, Template>

Definition at line 2852 of file inja.hpp.

◆ VoidCallbackFunction

using inja::VoidCallbackFunction = typedef std::function<void(Arguments &args)>

Definition at line 1569 of file inja.hpp.

Function Documentation

◆ get_source_location()

SourceLocation inja::get_source_location ( nonstd::string_view  content,
size_t  pos 
)
inline

Definition at line 1899 of file inja.hpp.

References inja::string_view::slice().

Referenced by inja::Lexer::current_position(), and inja::Renderer::throw_renderer_error().

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

◆ open_file_or_throw()

void inja::open_file_or_throw ( const std::string &  path,
std::ifstream &  file 
)
inline

Definition at line 1866 of file inja.hpp.

References mad_mage_user::file, INJA_THROW, and python_init::path.

Referenced by inja::Parser::load_file(), and inja::Environment::load_json().

+ Here is the caller graph for this function:

◆ render()

std::string inja::render ( nonstd::string_view  input,
const json data 
)
inline

render with default settings to a string

Definition at line 4416 of file inja.hpp.

References navar-midane_time::data, and inja::Environment::render().

Referenced by inja::Environment::render_file(), and inja::Environment::write().

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

◆ render_to()

void inja::render_to ( std::ostream &  os,
nonstd::string_view  input,
const json data 
)
inline

render with default settings to the given output stream

Definition at line 4423 of file inja.hpp.

References navar-midane_time::data, and env.

Referenced by inja::Environment::render(), and inja::Renderer::visit().

+ Here is the caller graph for this function:

◆ replace_substring()

void inja::replace_substring ( std::string &  s,
const std::string &  f,
const std::string &  t 
)
inline

Definition at line 1922 of file inja.hpp.

References Floor::t.

Referenced by inja::Renderer::visit().

+ Here is the caller graph for this function: