Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "container.h"
- #include "array.h"
- #include "Engine.h"
- #define hardDebug
- #ifdef hardDebug
- #include "debug.h"
- void printElem(container* elem, int indent)
- {
- for (int i =0; i<indent ;i++)
- {
- LOG (" ");
- }
- switch ( elem->getType() )
- {
- case container::tObject :
- case container::tArray :
- {
- LOG( "["<<elem<<"]"<<EL);
- for (int i =0; i<indent ;i++)
- {
- LOG (" ");
- }
- LOG("[" << EL);
- std::vector<container*> e = elem->getArray();
- for (auto i : (e) )
- {
- printElem(i, indent+1);
- }
- for (int i =0; i<indent ;i++)
- {
- LOG (" ");
- }
- LOG( "]"<< EL );
- }
- break;
- case container::tNULL :
- LOG( ("NULL element") << EL );
- break;
- default:
- {
- std::string kek = elem->getString();
- LOG( (kek) << EL );
- }
- break;
- }
- }
- #endif // hardDebug
- int main(int argc, char* argv[])
- {
- container JSON;
- JSON.parseJSONfile("menu.json");
- #ifdef hardDebug
- LOG("Printing JSON that had been just readed : "<< EL);
- printElem(&JSON, 1);
- #endif // hardDebug
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement