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

Side by Side Diff: base/json/string_escape.cc

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/json/json_writer.cc ('k') | base/lazy_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/json/string_escape.h"
6
7 #include <string> 5 #include <string>
8 6
7 #include "base/string16.h"
9 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 namespace { 13 namespace {
14 14
15 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful, 15 // Try to escape |c| as a "SingleEscapeCharacter" (\n, etc). If successful,
16 // returns true and appends the escape sequence to |dst|. This isn't required 16 // returns true and appends the escape sequence to |dst|. This isn't required
17 // by the spec, but it's more readable by humans than the \uXXXX alternatives. 17 // by the spec, but it's more readable by humans than the \uXXXX alternatives.
18 template<typename CHAR> 18 template<typename CHAR>
19 static bool JsonSingleEscapeChar(const CHAR c, std::string* dst) { 19 static bool JsonSingleEscapeChar(const CHAR c, std::string* dst) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 JsonDoubleQuoteT(str, put_in_quotes, dst); 95 JsonDoubleQuoteT(str, put_in_quotes, dst);
96 } 96 }
97 97
98 std::string GetDoubleQuotedJson(const string16& str) { 98 std::string GetDoubleQuotedJson(const string16& str) {
99 std::string dst; 99 std::string dst;
100 JsonDoubleQuote(str, true, &dst); 100 JsonDoubleQuote(str, true, &dst);
101 return dst; 101 return dst;
102 } 102 }
103 103
104 } // namespace base 104 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_writer.cc ('k') | base/lazy_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698