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

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

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/json/json_writer_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <cmath> 7 #include <cmath>
8 8
9 #include "base/json/string_escape.h" 9 #include "base/json/string_escape.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 #if defined(OS_WIN)
18 const char kPrettyPrintLineEnding[] = "\r\n";
19 #else
20 const char kPrettyPrintLineEnding[] = "\n"; 17 const char kPrettyPrintLineEnding[] = "\n";
21 #endif
22 18
23 // static 19 // static
24 bool JSONWriter::Write(const Value& node, std::string* json) { 20 bool JSONWriter::Write(const Value& node, std::string* json) {
25 return WriteWithOptions(node, 0, json); 21 return WriteWithOptions(node, 0, json);
26 } 22 }
27 23
28 // static 24 // static
29 bool JSONWriter::WriteWithOptions(const Value& node, 25 bool JSONWriter::WriteWithOptions(const Value& node,
30 int options, 26 int options,
31 std::string* json) { 27 std::string* json) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 195 }
200 NOTREACHED(); 196 NOTREACHED();
201 return false; 197 return false;
202 } 198 }
203 199
204 void JSONWriter::IndentLine(size_t depth) { 200 void JSONWriter::IndentLine(size_t depth) {
205 json_string_->append(depth * 3U, ' '); 201 json_string_->append(depth * 3U, ' ');
206 } 202 }
207 203
208 } // namespace base 204 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/json/json_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698