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

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

Issue 632103004: Cleanup: Better constify some strings in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad refactoring Created 6 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
« no previous file with comments | « base/json/json_parser.cc ('k') | base/json/json_reader.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 // A JSON parser. Converts strings of JSON into a Value object (see 5 // A JSON parser. Converts strings of JSON into a Value object (see
6 // base/values.h). 6 // base/values.h).
7 // http://www.ietf.org/rfc/rfc4627.txt?number=4627 7 // http://www.ietf.org/rfc/rfc4627.txt?number=4627
8 // 8 //
9 // Known limitations/deviations from the RFC: 9 // Known limitations/deviations from the RFC:
10 // - Only knows how to parse ints within the range of a signed 32 bit int and 10 // - Only knows how to parse ints within the range of a signed 32 bit int and
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 JSON_UNEXPECTED_TOKEN, 68 JSON_UNEXPECTED_TOKEN,
69 JSON_TRAILING_COMMA, 69 JSON_TRAILING_COMMA,
70 JSON_TOO_MUCH_NESTING, 70 JSON_TOO_MUCH_NESTING,
71 JSON_UNEXPECTED_DATA_AFTER_ROOT, 71 JSON_UNEXPECTED_DATA_AFTER_ROOT,
72 JSON_UNSUPPORTED_ENCODING, 72 JSON_UNSUPPORTED_ENCODING,
73 JSON_UNQUOTED_DICTIONARY_KEY, 73 JSON_UNQUOTED_DICTIONARY_KEY,
74 JSON_PARSE_ERROR_COUNT 74 JSON_PARSE_ERROR_COUNT
75 }; 75 };
76 76
77 // String versions of parse error codes. 77 // String versions of parse error codes.
78 static const char* kInvalidEscape; 78 static const char kInvalidEscape[];
79 static const char* kSyntaxError; 79 static const char kSyntaxError[];
80 static const char* kUnexpectedToken; 80 static const char kUnexpectedToken[];
81 static const char* kTrailingComma; 81 static const char kTrailingComma[];
82 static const char* kTooMuchNesting; 82 static const char kTooMuchNesting[];
83 static const char* kUnexpectedDataAfterRoot; 83 static const char kUnexpectedDataAfterRoot[];
84 static const char* kUnsupportedEncoding; 84 static const char kUnsupportedEncoding[];
85 static const char* kUnquotedDictionaryKey; 85 static const char kUnquotedDictionaryKey[];
86 86
87 // Constructs a reader with the default options, JSON_PARSE_RFC. 87 // Constructs a reader with the default options, JSON_PARSE_RFC.
88 JSONReader(); 88 JSONReader();
89 89
90 // Constructs a reader with custom options. 90 // Constructs a reader with custom options.
91 explicit JSONReader(int options); 91 explicit JSONReader(int options);
92 92
93 ~JSONReader(); 93 ~JSONReader();
94 94
95 // Reads and parses |json|, returning a Value. The caller owns the returned 95 // Reads and parses |json|, returning a Value. The caller owns the returned
(...skipping 29 matching lines...) Expand all
125 // numbers if appropriate. 125 // numbers if appropriate.
126 std::string GetErrorMessage() const; 126 std::string GetErrorMessage() const;
127 127
128 private: 128 private:
129 scoped_ptr<internal::JSONParser> parser_; 129 scoped_ptr<internal::JSONParser> parser_;
130 }; 130 };
131 131
132 } // namespace base 132 } // namespace base
133 133
134 #endif // BASE_JSON_JSON_READER_H_ 134 #endif // BASE_JSON_JSON_READER_H_
OLDNEW
« no previous file with comments | « base/json/json_parser.cc ('k') | base/json/json_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698