example1_helloworld.cpp 419 Bytes
Newer Older
oscar's avatar
oscar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <iostream>
#include <string>

#include "ajson.hpp"

using namespace std;
using namespace ajson;

struct demo
{
  string hello;
  string world;
};

AJSON(demo,hello,world)

int main(int argc, char * argv[])
{
	char * buff = "{\"hello\" : \"Hello\", \"world\" : \"world.\"}";
	demo the_demo;
	load_from_buff(the_demo,buff);
	cout << the_demo.hello << " " << the_demo.world << std::endl;
	cin.get();
	return 0;
}