Permalink
Browse files

Uncommented and updated example

Example now works
  • Loading branch information...
1 parent fcb82eb commit 1a6d2b11cd02ef8d14a90de446519f9812221de5 @cheukyin699 cheukyin699 committed Jun 22, 2014
Showing with 11 additions and 11 deletions.
  1. +11 −11 examples/main.cpp
View
@@ -1,28 +1,28 @@
#include <iostream>
#include <string>
-#include "JsonBox/Value.h"
+#include "JsonBox.h"
int main (int argc, const char * argv[]) {
- /*JsonBox::Object o;
+ JsonBox::Object o;
o["myName"] = JsonBox::Value(123);
o["myOtherMember"] = JsonBox::Value("asld\\kfn");
o["hahaha"] = JsonBox::Value(true);
o["adamo"] = JsonBox::Value(129.09);
std::cout << o << std::endl;
JsonBox::Value v(o);
- v.writeToFile("path to your file");*/
+ v.writeToFile("file.json");
- /*JsonBox::Array a;
+ JsonBox::Array a;
a.push_back(JsonBox::Value("I'm a string..."));
a.push_back(JsonBox::Value(123));
- std::cout << a << std::endl;*/
+ std::cout << a << std::endl;
- //JsonBox::Value v2;
- //v2.loadFromFile("path to your file");
- //std::cout << v2 << std::endl;
- //v2.writeToStream(std::cout, true, true);
- //v2.writeToFile("path to your file", false, false);
- return 0;
+ JsonBox::Value v2;
+ v2.loadFromFile("file.json");
+ std::cout << v2 << std::endl;
+ v2.writeToStream(std::cout, true, true);
+ v2.writeToFile("file.json", false, false);
+ return 0;
}

0 comments on commit 1a6d2b1

Please sign in to comment.