Inja 3.5.0
A Template Engine for Modern C++
Loading...
Searching...
No Matches
config.hpp
1#ifndef INCLUDE_INJA_CONFIG_HPP_
2#define INCLUDE_INJA_CONFIG_HPP_
3
4#include <filesystem>
5#include <functional>
6#include <string>
7
8#include "template.hpp"
9
10namespace inja {
11
16 std::string statement_open {"{%"};
17 std::string statement_open_no_lstrip {"{%+"};
18 std::string statement_open_force_lstrip {"{%-"};
19 std::string statement_close {"%}"};
20 std::string statement_close_force_rstrip {"-%}"};
21 std::string line_statement {"##"};
22 std::string expression_open {"{{"};
23 std::string expression_open_force_lstrip {"{{-"};
24 std::string expression_close {"}}"};
25 std::string expression_close_force_rstrip {"-}}"};
26 std::string comment_open {"{#"};
27 std::string comment_open_force_lstrip {"{#-"};
28 std::string comment_close {"#}"};
29 std::string comment_close_force_rstrip {"-#}"};
30 std::string open_chars {"#{"};
31
32 bool trim_blocks {false};
33 bool lstrip_blocks {false};
34
35 void update_open_chars() {
36 open_chars = "";
37 if (open_chars.find(line_statement[0]) == std::string::npos) {
38 open_chars += line_statement[0];
39 }
40 if (open_chars.find(statement_open[0]) == std::string::npos) {
41 open_chars += statement_open[0];
42 }
43 if (open_chars.find(statement_open_no_lstrip[0]) == std::string::npos) {
44 open_chars += statement_open_no_lstrip[0];
45 }
46 if (open_chars.find(statement_open_force_lstrip[0]) == std::string::npos) {
47 open_chars += statement_open_force_lstrip[0];
48 }
49 if (open_chars.find(expression_open[0]) == std::string::npos) {
50 open_chars += expression_open[0];
51 }
52 if (open_chars.find(expression_open_force_lstrip[0]) == std::string::npos) {
53 open_chars += expression_open_force_lstrip[0];
54 }
55 if (open_chars.find(comment_open[0]) == std::string::npos) {
56 open_chars += comment_open[0];
57 }
58 if (open_chars.find(comment_open_force_lstrip[0]) == std::string::npos) {
59 open_chars += comment_open_force_lstrip[0];
60 }
61 }
62};
63
68 bool search_included_templates_in_files {true};
69
70 std::function<Template(const std::filesystem::path&, const std::string&)> include_callback;
71};
72
77 bool throw_at_missing_includes {true};
78 bool html_autoescape {false};
79};
80
81} // namespace inja
82
83#endif // INCLUDE_INJA_CONFIG_HPP_
Class for lexer configuration.
Definition config.hpp:15
Class for parser configuration.
Definition config.hpp:67
Class for render configuration.
Definition config.hpp:76
The main inja Template.
Definition template.hpp:16