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

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

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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_reader.cc ('k') | base/process_util_linux.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/json_writer.h" 5 #include "base/json/json_writer.h"
6 6
7 #include "base/json/string_escape.h" 7 #include "base/json/string_escape.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/string_number_conversions.h"
10 #include "base/values.h" 11 #include "base/values.h"
11 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
12 13
13 namespace base { 14 namespace base {
14 15
15 #if defined(OS_WIN) 16 #if defined(OS_WIN)
16 static const char kPrettyPrintLineEnding[] = "\r\n"; 17 static const char kPrettyPrintLineEnding[] = "\r\n";
17 #else 18 #else
18 static const char kPrettyPrintLineEnding[] = "\n"; 19 static const char kPrettyPrintLineEnding[] = "\n";
19 #endif 20 #endif
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 JsonDoubleQuote(WideToUTF16Hack(str), true, json_string_); 192 JsonDoubleQuote(WideToUTF16Hack(str), true, json_string_);
192 } 193 }
193 194
194 void JSONWriter::IndentLine(int depth) { 195 void JSONWriter::IndentLine(int depth) {
195 // It may be faster to keep an indent string so we don't have to keep 196 // It may be faster to keep an indent string so we don't have to keep
196 // reallocating. 197 // reallocating.
197 json_string_->append(std::string(depth * 3, ' ')); 198 json_string_->append(std::string(depth * 3, ' '));
198 } 199 }
199 200
200 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_reader.cc ('k') | base/process_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698