Skip to content

A C++17 single-file header-only library to wrap RapidJSON SAX interface

License

Notifications You must be signed in to change notification settings

yhirose/cpp-jsonlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cpp-jsonlib

A C++17 single-file header-only library for RapidJSON SAX interface

#include <iostream>
#include "jsonlib.h"

int main(void) {
  std::string json;
  while (std::getline(std::cin, json)) {
    std::string key;
    jsonlib::parse(json, {
      .Key = [&](auto str, auto len) {
        key.assign(str, len);
      },
      .String = [&](auto str, auto len) {
        std::cout << key << ": " << std::string(str, len) << std::endl;
      }
    });
  }
}

About

A C++17 single-file header-only library to wrap RapidJSON SAX interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages