diff options
author | 2016-03-01 06:45:41 +1100 | |
---|---|---|
committer | 2016-03-01 06:52:36 +1100 | |
commit | a830ea76270b7894a03922a172d58bfaefbc827f (patch) | |
tree | 01d929c08c8fa3e66285a3130004d4aa5d31e393 /src/tools/src2html.cpp | |
parent | b2fc583ed75b19321849fcd4fec518e2b719294b (diff) |
* Support *n conversion in stream_format/string_format
* Make stream_format return characters printed
* Add iostreams with std::vector storage
* Move to type-safe templates for logerror and popmessage
* Remove now-unnecessary I64FMT from calls to logerror/popmessage
* Put some lib/util stuff in util:: namespace
* Some fixes to Japanese translation
Diffstat (limited to 'src/tools/src2html.cpp')
-rw-r--r-- | src/tools/src2html.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/src2html.cpp b/src/tools/src2html.cpp index a93d7de73b8..557313f1b3e 100644 --- a/src/tools/src2html.cpp +++ b/src/tools/src2html.cpp @@ -549,7 +549,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri { // start with the line number dstline.str(""); - stream_format(dstline, "<span class=\"linenum\">%5d</span> ", linenum++); + util::stream_format(dstline, "<span class=\"linenum\">%5d</span> ", linenum++); // iterate over characters in the source line bool escape = false; @@ -569,7 +569,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri { if (!in_comment && ch == comment_start[0] && strncmp(srcptr - 1, comment_start, strlen(comment_start)) == 0) { - stream_format(dstline, "<span class=\"comment\">%s", comment_start_esc); + util::stream_format(dstline, "<span class=\"comment\">%s", comment_start_esc); curcol += strlen(comment_start); srcptr += strlen(comment_start) - 1; ch = 0; @@ -577,7 +577,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri } else if (in_comment && ch == comment_end[0] && strncmp(srcptr - 1, comment_end, strlen(comment_end)) == 0) { - stream_format(dstline, "%s</span>", comment_end_esc); + util::stream_format(dstline, "%s</span>", comment_end_esc); curcol += strlen(comment_end); srcptr += strlen(comment_end) - 1; ch = 0; @@ -588,7 +588,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri // track whether or not we are within an inline (C++-style) comment if (!in_quotes && !in_comment && !in_inline_comment && ch == comment_inline[0] && strncmp(srcptr - 1, comment_inline, strlen(comment_inline)) == 0) { - stream_format(dstline, "<span class=\"comment\">%s", comment_inline_esc); + util::stream_format(dstline, "<span class=\"comment\">%s", comment_inline_esc); curcol += strlen(comment_inline); srcptr += strlen(comment_inline) - 1; ch = 0; @@ -612,7 +612,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri for (curtoken = token_table; curtoken->token != nullptr; curtoken++) if (strncmp(srcptr - 1, curtoken->token, toklength) == 0 && strlen(curtoken->token) == toklength) { - stream_format(dstline, "<span class=\"%s\">%s</span>", curtoken->color, curtoken->token); + util::stream_format(dstline, "<span class=\"%s\">%s</span>", curtoken->color, curtoken->token); curcol += strlen(curtoken->token); srcptr += strlen(curtoken->token) - 1; ch = 0; @@ -644,7 +644,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri if (!in_comment && !in_inline_comment && !in_quotes && (ch == '"' || ch == '\'')) { if (color_quotes) - stream_format(dstline, "<span class=\"string\">%c", ch); + util::stream_format(dstline, "<span class=\"string\">%c", ch); else dstline.put(ch); in_quotes = true; @@ -660,7 +660,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri std::string target; if (find_include_file(target, srcrootlen, dstrootlen, srcfile, dstfile, filename)) { - stream_format(dstline, "<a href=\"%s\">", target.c_str()); + util::stream_format(dstline, "<a href=\"%s\">", target.c_str()); quotes_are_linked = true; } } @@ -673,7 +673,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri if (quotes_are_linked) dstline << "</a>"; if (color_quotes) - stream_format(dstline, "%c</span>", ch); + util::stream_format(dstline, "%c</span>", ch); else dstline.put(ch); in_quotes = false; |