wangxiaowei0303 / rapidjson

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

GenericDocument::ParseStream: make SourceEncoding optional #107

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The GenericDocument::ParseStream() function template currently requires passing 
the SourceEncoding parameter as explicit template argument while the other 
Parse*() functions provide overloads to omit this parameter and use the 
document's own encoding by default.

The patch at https://github.com/pah/rapidjson/commit/77e5c6b1 adds the missing 
overload for ParseStream() as well:

    template <unsigned parseFlags, typename InputStream>
    GenericDocument& ParseStream(InputStream& is) {
        return ParseStream<parseFlags,Encoding,InputStream>(is);
    }

This enables the simple usage again:

    rapidjson::FileStream is(fp);
    rapidjson::Document d;
    d.ParseStream<0>(is);

Original issue reported on code.google.com by philipp....@gmail.com on 2 Apr 2014 at 2:32

GoogleCodeExporter commented 8 years ago
https://github.com/miloyip/rapidjson/commit/84f64ba58a73a0898ad78ea239323942b63c
6d51

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