This thing, write C + + plug-in can be used. Rapidjson--c++ Fast JSON Parser and generator

Source: Internet
Author: User



Original:


Rapidjson--c++ Fast JSON Parser and generator time 2015-04-05 07:33:33 Open source China News original Http://www.oschina.net/p/rapidjson


April 18 Wuhan Source Chong will start registration, send Development Board



Rapidjson is a C + + fast JSON parser and generator that uses the Sax/dom style API design.






Example code:


Rapidjson/example/simpledom/simpledom.cpp '#include "Rapidjson/document.h"#include "Rapidjson/writer.h"#include "Rapidjson/stringbuffer.h"#include <iostream>Usingnamespace Rapidjson;int main () { 1. Parse a JSON string into DOM. Constchar* JSON ="{\" project\ ": \" rapidjson\ ", \" Stars\ ": 10}"; Document D;  D.parse (JSON);  //2. Modify it by Dom. value& s = D[ "stars"]; S.setint (s . GetInt () + 1);  //3. Stringify the Dom StringBuffer buffer; writer<stringbuffer> writer (buffer);  D.accept (writer);  //Output {"Project": "Rapidjson", "Stars": 11} Span class= "built_in" >std::cout << buffer. GetString () << std::endl; return 0;}          


Introduction PPT Download: http://www.oschina.net/doc/5711



Main Features:


  • Small, full-featured, sax and DOM-style APIs, only a SAX parser with only hundred lines of code

  • Fast

  • No reliance on other third-party libraries

  • Compact. Each JSON value is a bytes for a or 64-bit machines respectively (excluding text string storage). With the custom memory allocator, parser allocates memory compactly during parsing.

  • Fully compatible with RFC4627, support UTF-8, UTF-16 and UTF-32.

  • Support both In-situ parsing (directly decode strings into the source JSON text) and non-destructive parsing (decode Strin GS into new buffers).

  • Parse number to int/unsigned/int64_t/uint64_t/double depending on input

  • Supports custom memory allocations. Also, the default memory pool allocator can Also is supplied with a user buffer (such as a buffer allocated on user ' s heap or programme stack) to minimize allocation.


This thing, write C + + plug-in can be used. Rapidjson--c++ Fast JSON Parser and generator


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.