Skip to content

Fast and simple JSON serialization 🏎️.

License

Notifications You must be signed in to change notification settings

rmGFW/speedyj

 
 

Repository files navigation

speedyj

About

Speedyj is a tiny C++ library for JSON serialization.

Building

mkdir build && cd build
cmake .. && cmake --build .

Testing

ctest .

Usage

#include "speedyj/speedyj.hpp"

namespace sj = speedyj;

/* Create a stream. */
sj::Stream s;

/* Serialize on object. */
s << sj::Object
  /* Key/value: */
  << "key" << "value"
  /* Nested array: */
  << "key-to-array" << sj::Array << 1.5 << sj::False << sj::True << sj::Null << sj::End
  /* Nested object: */
  << "nested-object" << sj:Object << "key" << "value" << sj::End
  /* Push std::vector as array: */
  << "vector" << std::vector<int>{{ 1, 2, 3, 4, 5, 6 }}
  /* Push std::map as object: */
  << "map" << std::map<std::string, int>{{"a", 1}, {"b", 2}}
  << sj::End;

/* Get the streams string. */
std::cout << s.str() << "\n";

About

Fast and simple JSON serialization 🏎️.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 90.0%
  • CMake 10.0%