本文整理汇总了C++中Members::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Members::push_back方法的具体用法?C++ Members::push_back怎么用?C++ Members::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Members
的用法示例。
在下文中一共展示了Members::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Members
Value::Members
Value::getMemberNames () const
{
JSON_ASSERT ( type_ == nullValue || type_ == objectValue );
if ( type_ == nullValue )
return Value::Members ();
Members members;
members.reserve ( value_.map_->size () );
#ifndef JSON_VALUE_USE_INTERNAL_MAP
ObjectValues::const_iterator it = value_.map_->begin ();
ObjectValues::const_iterator itEnd = value_.map_->end ();
for ( ; it != itEnd; ++it )
members.push_back ( std::string ( (*it).first.c_str () ) );
#else
ValueInternalMap::IteratorState it;
ValueInternalMap::IteratorState itEnd;
value_.map_->makeBeginIterator ( it );
value_.map_->makeEndIterator ( itEnd );
for ( ; !ValueInternalMap::equals ( it, itEnd ); ValueInternalMap::increment (it) )
members.push_back ( std::string ( ValueInternalMap::key ( it ) ) );
#endif
return members;
}
示例2: getMemberNames
Value::Members Value::getMemberNames() const {
JSON_ASSERT_MESSAGE(
type() == nullValue || type() == objectValue,
"in Json::Value::getMemberNames(), value must be objectValue");
if (type() == nullValue)
return Value::Members();
Members members;
members.reserve(value_.map_->size());
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
for (; it != itEnd; ++it) {
members.push_back(String((*it).first.data(), (*it).first.length()));
}
return members;
}
示例3: Members
Value::Members
Value::getMemberNames() const
{
JSON_ASSERT( type_ == nullValue || type_ == objectValue );
if ( type_ == nullValue )
return Value::Members();
Members members;
members.reserve( value_.map_->size() );
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
for ( ; it != itEnd; ++it )
members.push_back( std::string( (*it).first.c_str() ) );
return members;
}