mirror of
https://github.com/szymon-jozef/static-site-generator.git
synced 2026-09-07 12:10:42 +02:00
rename replace to replace_once
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
static bool replace(std::string &str, const std::string &from,
|
||||
const std::string &to) {
|
||||
static bool replace_once(std::string &str, const std::string &from,
|
||||
const std::string &to) {
|
||||
size_t start_pos = str.find(from);
|
||||
if (start_pos == std::string::npos)
|
||||
return false;
|
||||
@@ -23,7 +23,7 @@ std::string inject_html_into_template(const std::string &FILE_NAME,
|
||||
std::ostringstream ss;
|
||||
ss << file.rdbuf();
|
||||
result = ss.str();
|
||||
if (replace(result, TEMPLATE, HTML)) {
|
||||
if (replace_once(result, TEMPLATE, HTML)) {
|
||||
return result;
|
||||
}
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user