0.0.14 • Published 9 years ago

jsoncpp v0.0.14

Weekly downloads
3
License
GPL-2.0
Repository
github
Last release
9 years ago

##install

npm install -g jsoncpp

##usage

jsoncpp $input.json $output.h

##example input

{
    "wtf": { 
        "right": true,
        "zippo": null,
        "strings": [ "hello", "arrays" ]
    },
    "wrong": true, 
     "three": 3, 
     "arr": [ 3, false, "something" ],
     "single": "string",
     "nothing": null
}   

##example output

#ifndef TEST2_DATA_JSON_LW9O5SXX0LLERK9
#define TEST2_DATA_JSON_LW9O5SXX0LLERK9
namespace static_port_test2_data
{
template <class T = std::string, class U = int>
struct json
{
  typedef T string_type;
  typedef U number_type;
  std::nullptr_t _nothing;
  bool _wrong = true;
  number_type _three = 3;
  string_type _single = "string";
  struct wtf_type
  {
    std::nullptr_t _zippo;
    bool _right = true;
    std::tuple<string_type, string_type> _strings = {"hello", "arrays"};
    template<class V>
    void traverse(V & h)
    {
      h( "zippo", _zippo);
      h( "right", _right);
      h( "strings", _strings);
    }
  };
  wtf_type _wtf = {};
  std::tuple<number_type, bool, string_type> _arr = {3, false, "something"};
  template<class V>
  void traverse(V & h)
  {
    h( "nothing", _nothing);
    h( "wrong", _wrong);
    h( "three", _three);
    h( "single", _single);
    h( "wtf", _wtf);
    h( "arr", _arr);
  }
};
}
#endif
0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago