Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: tools/gn/visual_studio_writer.cc

Issue 2813213002: Moved/renamed EscapeString from visual_studio_writer to XmlEscape in xml_element_writer. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/xml_element_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/visual_studio_writer.cc
diff --git a/tools/gn/visual_studio_writer.cc b/tools/gn/visual_studio_writer.cc
index 76ebc5620fa39db6be2c720e848b8afd5dde3625..aa01d8217a6bcee876b3291c456efe7bb886910a 100644
--- a/tools/gn/visual_studio_writer.cc
+++ b/tools/gn/visual_studio_writer.cc
@@ -37,41 +37,9 @@
namespace {
-std::string EscapeString(const std::string& value) {
- std::string result;
- for (char c : value) {
- switch (c) {
- case '\n':
- result += "
";
- break;
- case '\r':
- result += "
";
- break;
- case '\t':
- result += "	";
- break;
- case '"':
- result += """;
- break;
- case '<':
- result += "&lt;";
- break;
- case '>':
- result += "&gt;";
- break;
- case '&':
- result += "&amp;";
- break;
- default:
- result += c;
- }
- }
- return result;
-}
-
struct SemicolonSeparatedWriter {
void operator()(const std::string& value, std::ostream& out) const {
- out << EscapeString(value) + ';';
+ out << XmlEscape(value) + ';';
}
};
« no previous file with comments | « no previous file | tools/gn/xml_element_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698