ctelroy / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

Patch for iostream support #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have added implementations for std::istream and std::ostream compatible 
stream objects for rapidjson.  See attached patch.

Original issue reported on code.google.com by matthew....@gmail.com on 18 Mar 2012 at 4:35

Attachments:

GoogleCodeExporter commented 8 years ago
I meant to flag this as an enhancement when creating the issue -- my 
apologies...

Original comment by matthew....@gmail.com on 18 Mar 2012 at 4:36

GoogleCodeExporter commented 8 years ago
I had the same problem and fixed it this way. Also wrote an ostream wrapper.
One thing to mention about the istream wrapper:

int Peek() {
   return _is->eof() ? '\0' : _is->peek();
}

peek kind of has to check for eof, otherwise it will return -1 instead of '\0'

Is there a way to read the first of multiple top level objects - particularly 
when reading from stream/socket?

Original comment by ppadev...@gmail.com on 15 May 2012 at 1:54

GoogleCodeExporter commented 8 years ago

Original comment by milo...@gmail.com on 18 Oct 2012 at 8:21

GoogleCodeExporter commented 8 years ago

Original comment by milo...@gmail.com on 24 Jun 2014 at 2:08