| 1000 | } |
| 1001 | |
| 1002 | std::vector<Reader::StructuredError> Reader::getStructuredErrors() const { |
| 1003 | std::vector<Reader::StructuredError> allErrors; |
| 1004 | for (Errors::const_iterator itError = errors_.begin(); |
| 1005 | itError != errors_.end(); |
| 1006 | ++itError) { |
| 1007 | const ErrorInfo &error = *itError; |
| 1008 | Reader::StructuredError structured; |
| 1009 | structured.offset_start = error.token_.start_ - begin_; |
| 1010 | structured.offset_limit = error.token_.end_ - begin_; |
| 1011 | structured.message = error.message_; |
| 1012 | allErrors.push_back(structured); |
| 1013 | } |
| 1014 | return allErrors; |
| 1015 | } |
| 1016 | |
| 1017 | std::istream &operator>>(std::istream &sin, Value &root) { |
| 1018 | Json::Reader reader; |