mirror of
https://github.com/pantor/inja.git
synced 2026-05-20 11:15:28 +00:00
static load file
This commit is contained in:
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
Template parse_template(const std::string& filename) {
|
||||
Parser parser(parser_config, lexer_config, template_storage, function_storage);
|
||||
auto result = Template(parser.load_file(input_path + static_cast<std::string>(filename)));
|
||||
auto result = Template(Parser::load_file(input_path + static_cast<std::string>(filename)));
|
||||
parser.parse_into_template(result, input_path + static_cast<std::string>(filename));
|
||||
return result;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
|
||||
std::string load_file(const std::string& filename) {
|
||||
Parser parser(parser_config, lexer_config, template_storage, function_storage);
|
||||
return parser.load_file(input_path + filename);
|
||||
return Parser::load_file(input_path + filename);
|
||||
}
|
||||
|
||||
json load_json(const std::string& filename) {
|
||||
|
||||
@@ -634,7 +634,7 @@ public:
|
||||
sub_parser.parse_into(tmpl, path);
|
||||
}
|
||||
|
||||
std::string load_file(const std::string& filename) {
|
||||
static std::string load_file(const std::string& filename) {
|
||||
std::ifstream file;
|
||||
file.open(filename);
|
||||
if (file.fail()) {
|
||||
|
||||
Reference in New Issue
Block a user