本文整理汇总了C++中JsonIn::get_member_name方法的典型用法代码示例。如果您正苦于以下问题:C++ JsonIn::get_member_name方法的具体用法?C++ JsonIn::get_member_name怎么用?C++ JsonIn::get_member_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonIn
的用法示例。
在下文中一共展示了JsonIn::get_member_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_object
static void write_object( JsonIn &jsin, JsonOut &jsout, int depth, bool force_wrap )
{
jsout.start_object( force_wrap );
jsin.start_object();
while( !jsin.end_object() ) {
std::string name = jsin.get_member_name();
jsout.member( name );
bool override_wrap = false;
if( name == "rows" || name == "blueprint" ) {
// Introspect into the row, if it has more than one element, force it to wrap.
int in_start_pos = jsin.tell();
bool ate_seperator = jsin.get_ate_separator();
{
JsonArray arr = jsin.get_array();
if( arr.size() > 1 ) {
override_wrap = true;
}
}
jsin.seek( in_start_pos );
jsin.set_ate_separator( ate_seperator );
}
format( jsin, jsout, depth, override_wrap );
}
jsout.end_object();
}
示例2: write_object
static void write_object( JsonIn &jsin, JsonOut &jsout, int depth, bool force_wrap )
{
jsout.start_object( force_wrap );
jsin.start_object();
while( !jsin.end_object() ) {
std::string name = jsin.get_member_name();
jsout.member( name );
format( jsin, jsout, depth );
}
jsout.end_object();
}