Skip to content

dongmingsun/light-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

light-json

Introduction

A simple JSON library written in C++ following the tutorial in C by miloyip and referring a lot from the C++ version by Yuan-Hang

This project is mainly for self-practicing in C++ language and might not be rigorous in either grammer or C++ programming paradigm. It only implement part of the parsing functionality for the moment.

The source code for the lib is stored in dir lightjson

Usage Example

Suppose document is a raw Json string

#include <exception>
#include <iostream>
#include <memory>
#include <string>
#include "json.h"

using namespace lightjson;
using namespace std;

int main() {
  // document = ...
  Json json;
  try {
    json.Parse(document);
  } catch (std::exception &e) {
    cout << e.what() << endl;
  }
  return 0;
}

TODO

  • re-write the copy constructor for class Json
  • overload operator[] for JsonArray and JsonObject
  • add unit tests
  • add serializing function
  • add formatting function

About

A simple JSON library written in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published