Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example to not report syntax error on valid JSON input #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 10, 2017

  1. Fix example to not report syntax error on valid JSON input

    Adds parse_array_stop(size_t) override which returns true to
    the root_context class in the streaming.cc example.
    
    If not overriden, picojson::deny_parse_context::parse_array_stop(size_t)
    returns false what causes syntax error.
    
    Related issue: kazuho#82
    rmisev committed Sep 10, 2017
    Configuration menu
    Copy the full SHA
    5c1a23c View commit details
    Browse the repository at this point in the history
  2. Use more appropriate istreambuf_iterator in the streaming.cc example

    Used in the example std::istream_iterator skips whitespace and thus
    a parser can produce unexpected reult, e.g.:
    
     Input: [{"x":"test space","y":20}]
     Output: "testspace",20
    
    std::istreambuf_iterator does not skip whitespace, so is more
    appropriate:
    
     Output: "test space",20
    
    More info:
    http://en.cppreference.com/w/cpp/iterator/istream_iterator (see "Notes"
    section).
    rmisev committed Sep 10, 2017
    Configuration menu
    Copy the full SHA
    05a0d66 View commit details
    Browse the repository at this point in the history