示例#1
0
文件: raw_variant.hpp 项目: VicHao/fc
 inline void pack( Stream& s, const variant_object& v ) 
 {
    unsigned_int vs = (uint32_t)v.size();
    pack( s, vs );
    for( auto itr = v.begin(); itr != v.end(); ++itr )
    {
       pack( s, itr->key() );
       pack( s, itr->value() );
    }
 }
示例#2
0
文件: json.cpp 项目: bitshares/fc
   void to_stream( T& os, const variant_object& o, json::output_formatting format, uint32_t max_depth )
   {
       os << '{';
       auto itr = o.begin();

       while( itr != o.end() )
       {
          escape_string( itr->key(), os );
          os << ':';
          to_stream( os, itr->value(), format, max_depth );
          ++itr;
          if( itr != o.end() )
             os << ',';
       }
       os << '}';
   }