mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
Added structured error reporting to Reader.
This allows applications for interactively viewing or editing JSON to do a better job of highlighting errors. Also added offset accessors to Value, offering the same sort of functionality even for non-errors. Thanks to Zach Clifford (zacharyc@google.com) for the patch.
This commit is contained in:
@@ -442,6 +442,13 @@ namespace Json {
|
||||
iterator begin();
|
||||
iterator end();
|
||||
|
||||
// Accessors for the [start, limit) range of bytes within the JSON text from
|
||||
// which this value was parsed, if any.
|
||||
void setOffsetStart( size_t start );
|
||||
void setOffsetLimit( size_t limit );
|
||||
size_t getOffsetStart() const;
|
||||
size_t getOffsetLimit() const;
|
||||
|
||||
private:
|
||||
Value &resolveReference( const char *key,
|
||||
bool isStatic );
|
||||
@@ -509,6 +516,11 @@ namespace Json {
|
||||
int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
|
||||
# endif
|
||||
CommentInfo *comments_;
|
||||
|
||||
// [start, limit) byte offsets in the source JSON text from which this Value
|
||||
// was extracted.
|
||||
size_t start_;
|
||||
size_t limit_;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user