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

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

Issue 316016: Move the json-related files into a separate json directory. This hopefully al... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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_unittest.cc ('k') | base/json/string_escape.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/string_escape.h:r69-2775
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 // This file defines utility functions for escaping strings. 5 // This file defines utility functions for escaping strings.
6 6
7 #ifndef BASE_STRING_ESCAPE_H__ 7 #ifndef BASE_JSON_STRING_ESCAPE_H_
8 #define BASE_STRING_ESCAPE_H__ 8 #define BASE_JSON_STRING_ESCAPE_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/string16.h" 12 #include "base/string16.h"
13 13
14 namespace string_escape { 14 namespace base {
15 15
16 // Escape |str| appropriately for a JSON string litereal, _appending_ the 16 // Escape |str| appropriately for a JSON string litereal, _appending_ the
17 // result to |dst|. This will create unicode escape sequences (\uXXXX). 17 // result to |dst|. This will create unicode escape sequences (\uXXXX).
18 // If |put_in_quotes| is true, the result will be surrounded in double quotes. 18 // If |put_in_quotes| is true, the result will be surrounded in double quotes.
19 // The outputted literal, when interpreted by the browser, should result in a 19 // The outputted literal, when interpreted by the browser, should result in a
20 // javascript string that is identical and the same length as the input |str|. 20 // javascript string that is identical and the same length as the input |str|.
21 void JsonDoubleQuote(const std::string& str, 21 void JsonDoubleQuote(const std::string& str,
22 bool put_in_quotes, 22 bool put_in_quotes,
23 std::string* dst); 23 std::string* dst);
24 24
25 void JsonDoubleQuote(const string16& str, 25 void JsonDoubleQuote(const string16& str,
26 bool put_in_quotes, 26 bool put_in_quotes,
27 std::string* dst); 27 std::string* dst);
28 28
29 29
30 } // namespace string_escape 30 } // namespace base
31 31
32 #endif // BASE_STRING_ESCAPE_H__ 32 #endif // BASE_JSON_STRING_ESCAPE_H_
OLDNEW
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/json/string_escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698