mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
remove pushError in CharReader (#1055)
This commit is contained in:
@@ -895,9 +895,6 @@ public:
|
||||
bool collectComments = true);
|
||||
String getFormattedErrorMessages() const;
|
||||
std::vector<StructuredError> getStructuredErrors() const;
|
||||
bool pushError(const Value& value, const String& message);
|
||||
bool pushError(const Value& value, const String& message, const Value& extra);
|
||||
bool good() const;
|
||||
|
||||
private:
|
||||
OurReader(OurReader const&); // no impl
|
||||
@@ -1841,42 +1838,6 @@ std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
|
||||
return allErrors;
|
||||
}
|
||||
|
||||
bool OurReader::pushError(const Value& value, const String& message) {
|
||||
ptrdiff_t length = end_ - begin_;
|
||||
if (value.getOffsetStart() > length || value.getOffsetLimit() > length)
|
||||
return false;
|
||||
Token token;
|
||||
token.type_ = tokenError;
|
||||
token.start_ = begin_ + value.getOffsetStart();
|
||||
token.end_ = begin_ + value.getOffsetLimit();
|
||||
ErrorInfo info;
|
||||
info.token_ = token;
|
||||
info.message_ = message;
|
||||
info.extra_ = nullptr;
|
||||
errors_.push_back(info);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OurReader::pushError(const Value& value, const String& message,
|
||||
const Value& extra) {
|
||||
ptrdiff_t length = end_ - begin_;
|
||||
if (value.getOffsetStart() > length || value.getOffsetLimit() > length ||
|
||||
extra.getOffsetLimit() > length)
|
||||
return false;
|
||||
Token token;
|
||||
token.type_ = tokenError;
|
||||
token.start_ = begin_ + value.getOffsetStart();
|
||||
token.end_ = begin_ + value.getOffsetLimit();
|
||||
ErrorInfo info;
|
||||
info.token_ = token;
|
||||
info.message_ = message;
|
||||
info.extra_ = begin_ + extra.getOffsetStart();
|
||||
errors_.push_back(info);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OurReader::good() const { return errors_.empty(); }
|
||||
|
||||
class OurCharReader : public CharReader {
|
||||
bool const collectComments_;
|
||||
OurReader reader_;
|
||||
|
Reference in New Issue
Block a user