Open Source & Linux Lab

It's better when it's simple

User Tools

Site Tools


etc:blog:json_parsers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

etc:blog:json_parsers [2009/11/15 14:48]
vood создано
etc:blog:json_parsers [2009/11/15 15:12] (current)
vood
Line 50: Line 50:
         std::cout << "​properties/​user/​type: ​ " << std::​string(type1) << std::endl;         std::cout << "​properties/​user/​type: ​ " << std::​string(type1) << std::endl;
         std::cout << "​properties/​channel/​type: ​ " << ​ std::​string(type2) << std::endl;         std::cout << "​properties/​channel/​type: ​ " << ​ std::​string(type2) << std::endl;
- return 0;+//Creating json request 
 +        Element newRoot; 
 +        QuickBuilder builder(newRoot);​ 
 +        builder["​description"​]=String("​subscribe to channel"​);​ 
 +        builder["​type"​]=String("​object"​);​ 
 +        builder["​properties"​]["​user"​]["​type"​]=String("​string"​);​ 
 +        builder["​properties"​]["​channel"​]["​type"​]=String("​string"​);​ 
 +        std::cout << "​Example of creating json:" << std::​endl;​ 
 +        Writer::​Write(newRoot,​std::​cout);​ 
 +        ​return 0;
 } }
 </​code>​ </​code>​
 +
  
  
 ~~DISCUSSION~~ ~~DISCUSSION~~
  
etc/blog/json_parsers.txt · Last modified: 2009/11/15 15:12 by vood