Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef BASE_JSON_JSON_PARSER_H_ | 5 #ifndef BASE_JSON_JSON_PARSER_H_ |
| 6 #define BASE_JSON_JSON_PARSER_H_ | 6 #define BASE_JSON_JSON_PARSER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 // Parses the input string according to the set options and returns the | 51 // Parses the input string according to the set options and returns the |
| 52 // result as a Value owned by the caller. | 52 // result as a Value owned by the caller. |
| 53 Value* Parse(const StringPiece& input); | 53 Value* Parse(const StringPiece& input); |
| 54 | 54 |
| 55 // Returns the error code. | 55 // Returns the error code. |
| 56 JSONReader::JsonParseError error_code() const; | 56 JSONReader::JsonParseError error_code() const; |
| 57 | 57 |
| 58 // Returns the human-friendly error message. | 58 // Returns the human-friendly error message. |
| 59 std::string GetErrorMessage() const; | 59 std::string GetErrorMessage() const; |
| 60 | 60 |
| 61 int error_line() const; | |
|
Nico
2016/01/13 20:50:39
Add a comment that explains when these return vali
horo
2016/01/14 02:25:45
Done.
| |
| 62 int error_column() const; | |
|
Nico
2016/01/13 20:50:39
There's so much error data here now -- does it mak
horo
2016/01/14 02:25:45
That sound good.
I will create another CL.
| |
| 63 | |
| 61 private: | 64 private: |
| 62 enum Token { | 65 enum Token { |
| 63 T_OBJECT_BEGIN, // { | 66 T_OBJECT_BEGIN, // { |
| 64 T_OBJECT_END, // } | 67 T_OBJECT_END, // } |
| 65 T_ARRAY_BEGIN, // [ | 68 T_ARRAY_BEGIN, // [ |
| 66 T_ARRAY_END, // ] | 69 T_ARRAY_END, // ] |
| 67 T_STRING, | 70 T_STRING, |
| 68 T_NUMBER, | 71 T_NUMBER, |
| 69 T_BOOL_TRUE, // true | 72 T_BOOL_TRUE, // true |
| 70 T_BOOL_FALSE, // false | 73 T_BOOL_FALSE, // false |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 FRIEND_TEST_ALL_PREFIXES(JSONParserTest, ConsumeNumbers); | 251 FRIEND_TEST_ALL_PREFIXES(JSONParserTest, ConsumeNumbers); |
| 249 FRIEND_TEST_ALL_PREFIXES(JSONParserTest, ErrorMessages); | 252 FRIEND_TEST_ALL_PREFIXES(JSONParserTest, ErrorMessages); |
| 250 | 253 |
| 251 DISALLOW_COPY_AND_ASSIGN(JSONParser); | 254 DISALLOW_COPY_AND_ASSIGN(JSONParser); |
| 252 }; | 255 }; |
| 253 | 256 |
| 254 } // namespace internal | 257 } // namespace internal |
| 255 } // namespace base | 258 } // namespace base |
| 256 | 259 |
| 257 #endif // BASE_JSON_JSON_PARSER_H_ | 260 #endif // BASE_JSON_JSON_PARSER_H_ |
| OLD | NEW |