Skip to content

Commit

Permalink
Merge pull request #1 from descarte1/reset-parser
Browse files Browse the repository at this point in the history
Added reset() to reuse parser
  • Loading branch information
descarte1 authored Dec 6, 2016
2 parents c12957f + d75e8b4 commit 74e868e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions JsonStreamingParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p
#include "JsonStreamingParser.h"

JsonStreamingParser::JsonStreamingParser() {
reset();
}

void JsonStreamingParser::reset() {
state = STATE_START_DOCUMENT;
bufferPos = 0;
unicodeEscapeBufferPos = 0;
Expand Down
2 changes: 1 addition & 1 deletion JsonStreamingParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ class JsonStreamingParser {
JsonStreamingParser();
void parse(char c);
void setListener(JsonListener* listener);

void reset();
};

0 comments on commit 74e868e

Please sign in to comment.