Code Monkey home page Code Monkey logo

freddy's Introduction

freddy

Thin C++11 STL wrapper for reading/writing JSON

License

This library is free software, released under the zlib license.

Brief

From json.org:

"JSON is built on two structures:

  • A collection of name/value pairs. In various languages, this is realized as an object ...
  • An ordered list of values. In most languages, this is realized as an array ...

These are universal data structures. Virtually all modern programming languages support them in one form or another."

It seems many JSON libraries overcomplicate things by re-implementing these standard data types, causing them to be bloated and infectious.

By contrast, this library aims to be non-intrusive, wrapping transparently around these data structures as they already exist in the Standard Library.

In fact, these components are just aliases for their std counterparts:

  • json::string => std::string
  • json::object => std::map<json::string, json::value>
  • json::array => std::vector<json::value>

json::value is the special type that can hold any of the following JSON types:

  • array
  • bool
  • null
  • number
  • object
  • string

std::shared_ptr is used internally for sane memory management.

Parsing works on streams as well as strings.

To make your class act as a json object, array or string, implement json::objectlike, json::arraylike or json::stringlike.

Currently, the library is header-only, but this is likely to change soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.