Skip to content

Commit c33858d

Browse files
refactor HTML generation block to use C++11 raw string literals
1 parent 0498496 commit c33858d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/games/writer.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ std::string WriteHTMLFile(const Game &p_game, const GamePlayer &p_rowPlayer,
5252

5353
theHtml += "<table>";
5454
theHtml += "<tr>";
55-
theHtml += "<td colspan=\"2\" rowspan=\"2\"></td>";
56-
theHtml += "<td colspan=\"" + std::to_string(p_colPlayer->GetStrategies().size()) +
57-
"\" align=\"center\"><b>";
55+
theHtml += R"(<td colspan="2" rowspan="2"></td>)";
56+
theHtml += R"(<td colspan=")" + std::to_string(p_colPlayer->GetStrategies().size()) +
57+
R"(" align="center"><b>)";
5858
theHtml += p_colPlayer->GetLabel();
5959
theHtml += "</b></td>";
6060
theHtml += "</tr>";
6161
theHtml += "<tr>";
6262
for (const auto &strategy : p_colPlayer->GetStrategies()) {
63-
theHtml += "<td align=\"center\"><b>";
63+
theHtml += R"(<td align="center"><b>)";
6464
theHtml += strategy->GetLabel();
6565
theHtml += "</b></td>";
6666
}
@@ -73,14 +73,14 @@ std::string WriteHTMLFile(const Game &p_game, const GamePlayer &p_rowPlayer,
7373
theHtml += "<tr>";
7474

7575
if (first_row_strategy) {
76-
theHtml += "<td rowspan=\"" + std::to_string(p_rowPlayer->GetStrategies().size()) +
77-
"\" align=\"center\" valign=\"middle\"><b>";
76+
theHtml += R"(<td rowspan=")" + std::to_string(p_rowPlayer->GetStrategies().size()) +
77+
R"(" align="center" valign="middle"><b>)";
7878
theHtml += p_rowPlayer->GetLabel();
7979
theHtml += "</b></td>";
8080
first_row_strategy = false;
8181
}
8282

83-
theHtml += "<td align=\"center\"><b>";
83+
theHtml += R"(<td align="center"><b>)";
8484
theHtml += row_strategy->GetLabel();
8585
theHtml += "</b></td>";
8686
for (const auto &col_strategy : p_colPlayer->GetStrategies()) {

0 commit comments

Comments
 (0)