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 #include "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 | 6 |
7 #include "base/json/json_parser.h" | 7 #include "base/json/json_parser.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 | 12 |
13 // Values 1000 and above are used by JSONFileValueSerializer::JsonFileError. | 13 // Values 1000 and above are used by JSONFileValueSerializer::JsonFileError. |
14 COMPILE_ASSERT(JSONReader::JSON_PARSE_ERROR_COUNT < 1000, | 14 static_assert(JSONReader::JSON_PARSE_ERROR_COUNT < 1000, |
15 json_reader_error_out_of_bounds); | 15 "JSONReader error out of bounds"); |
16 | 16 |
17 const char JSONReader::kInvalidEscape[] = | 17 const char JSONReader::kInvalidEscape[] = |
18 "Invalid escape sequence."; | 18 "Invalid escape sequence."; |
19 const char JSONReader::kSyntaxError[] = | 19 const char JSONReader::kSyntaxError[] = |
20 "Syntax error."; | 20 "Syntax error."; |
21 const char JSONReader::kUnexpectedToken[] = | 21 const char JSONReader::kUnexpectedToken[] = |
22 "Unexpected token."; | 22 "Unexpected token."; |
23 const char JSONReader::kTrailingComma[] = | 23 const char JSONReader::kTrailingComma[] = |
24 "Trailing comma not allowed."; | 24 "Trailing comma not allowed."; |
25 const char JSONReader::kTooMuchNesting[] = | 25 const char JSONReader::kTooMuchNesting[] = |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 JSONReader::JsonParseError JSONReader::error_code() const { | 106 JSONReader::JsonParseError JSONReader::error_code() const { |
107 return parser_->error_code(); | 107 return parser_->error_code(); |
108 } | 108 } |
109 | 109 |
110 std::string JSONReader::GetErrorMessage() const { | 110 std::string JSONReader::GetErrorMessage() const { |
111 return parser_->GetErrorMessage(); | 111 return parser_->GetErrorMessage(); |
112 } | 112 } |
113 | 113 |
114 } // namespace base | 114 } // namespace base |
OLD | NEW |