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

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

Issue 7461141: Rename BASE_API to BASE_EXPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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.h ('k') | base/json/string_escape.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef BASE_JSON_JSON_WRITER_H_ 5 #ifndef BASE_JSON_JSON_WRITER_H_
6 #define BASE_JSON_JSON_WRITER_H_ 6 #define BASE_JSON_JSON_WRITER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/base_api.h" 11 #include "base/base_export.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 class Value; 16 class Value;
17 17
18 class BASE_API JSONWriter { 18 class BASE_EXPORT JSONWriter {
19 public: 19 public:
20 // Given a root node, generates a JSON string and puts it into |json|. 20 // Given a root node, generates a JSON string and puts it into |json|.
21 // If |pretty_print| is true, return a slightly nicer formated json string 21 // If |pretty_print| is true, return a slightly nicer formated json string
22 // (pads with whitespace to help readability). If |pretty_print| is false, 22 // (pads with whitespace to help readability). If |pretty_print| is false,
23 // we try to generate as compact a string as possible. 23 // we try to generate as compact a string as possible.
24 // TODO(tc): Should we generate json if it would be invalid json (e.g., 24 // TODO(tc): Should we generate json if it would be invalid json (e.g.,
25 // |node| is not a DictionaryValue/ListValue or if there are inf/-inf float 25 // |node| is not a DictionaryValue/ListValue or if there are inf/-inf float
26 // values)? 26 // values)?
27 static void Write(const Value* const node, bool pretty_print, 27 static void Write(const Value* const node, bool pretty_print,
28 std::string* json); 28 std::string* json);
(...skipping 27 matching lines...) Expand all
56 std::string* json_string_; 56 std::string* json_string_;
57 57
58 bool pretty_print_; 58 bool pretty_print_;
59 59
60 DISALLOW_COPY_AND_ASSIGN(JSONWriter); 60 DISALLOW_COPY_AND_ASSIGN(JSONWriter);
61 }; 61 };
62 62
63 } // namespace base 63 } // namespace base
64 64
65 #endif // BASE_JSON_JSON_WRITER_H_ 65 #endif // BASE_JSON_JSON_WRITER_H_
OLDNEW
« no previous file with comments | « base/json/json_reader.h ('k') | base/json/string_escape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698