本文整理汇总了C++中json::ObjectEncoder类的典型用法代码示例。如果您正苦于以下问题:C++ ObjectEncoder类的具体用法?C++ ObjectEncoder怎么用?C++ ObjectEncoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectEncoder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: encodeJSON
void DictImpl::encodeJSON( void const *data, JSON::Encoder &encoder ) const
{
RC::ConstHandle<StringImpl> keyImplAsStringImpl;
if ( isString( m_keyImpl->getType() ) )
keyImplAsStringImpl = RC::ConstHandle<StringImpl>::StaticCast( m_keyImpl );
JSON::ObjectEncoder objectEncoder = encoder.makeObject();
bits_t const *bits = *reinterpret_cast<bits_t const * const *>( data );
if ( bits )
{
node_t *node = bits->firstNode;
while ( node )
{
void const *keyData = immutableKeyData( node );
void const *valueData = immutableValueData( node );
if ( keyImplAsStringImpl )
{
JSON::Encoder memberEncoder = objectEncoder.makeMember( keyImplAsStringImpl->getValueData( keyData ), keyImplAsStringImpl->getValueLength( keyData ) );
m_valueImpl->encodeJSON( valueData, memberEncoder );
}
else
{
Util::SimpleString encodedKey;
{
JSON::Encoder encodedKeyEncoder( &encodedKey );
m_keyImpl->encodeJSON( keyData, encodedKeyEncoder );
}
JSON::Encoder memberEncoder = objectEncoder.makeMember( encodedKey );
m_valueImpl->encodeJSON( valueData, memberEncoder );
}
node = node->bitsNextNode;
}
}
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:34,代码来源:DictImpl.cpp
示例2: appendJSONMembers
void MethodOp::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Expr::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_expr->appendJSON( jsonObjectEncoder.makeMember( "expr" ), includeLocation );
jsonObjectEncoder.makeMember( "methodName" ).makeString( m_name );
m_args->appendJSON( jsonObjectEncoder.makeMember( "args" ), includeLocation );
}
开发者ID:nikelin,项目名称:PublicStable,代码行数:7,代码来源:MethodOp.cpp
示例3: appendJSONMembers
void CreateArrayGenerator::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Expr::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_count->appendJSON( jsonObjectEncoder.makeMember( "count" ), includeLocation );
jsonObjectEncoder.makeMember( "operatorName" ).makeString( m_operatorName );
m_shared->appendJSON( jsonObjectEncoder.makeMember( "shared" ), includeLocation );
}
开发者ID:nikelin,项目名称:PublicStable,代码行数:7,代码来源:CreateArrayGenerator.cpp
示例4: appendJSONMembers
void ContainerLoop::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Statement::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_dictExpr->appendJSON( jsonObjectEncoder.makeMember( "dictExpr" ), includeLocation );
jsonObjectEncoder.makeMember( "keyName" ).makeString( m_keyName );
if ( m_valueName.length() > 0 )
jsonObjectEncoder.makeMember( "valueName" ).makeString( m_valueName );
m_body->appendJSON( jsonObjectEncoder.makeMember( "body" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:9,代码来源:ContainerLoop.cpp
示例5: toJSON
void ProducerWrapper::toJSON( JSON::Encoder &jsonEncoder ) const
{
JSON::ObjectEncoder jsonObjectEncoder = jsonEncoder.makeObject();
{
JSON::Encoder typeNameEncoder = jsonObjectEncoder.makeMember( "kind" );
typeNameEncoder.makeString( getKind() );
}
toJSONImpl( jsonObjectEncoder );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:11,代码来源:ProducerWrapper.cpp
示例6: jsonDesc
void Inst::jsonDesc( JSON::Encoder &resultEncoder ) const
{
JSON::ObjectEncoder resultObjectEncoder = resultEncoder.makeObject();
{
JSON::Encoder memberEncoder = resultObjectEncoder.makeMember( "code", 4 );
memberEncoder.makeString( m_code );
}
{
JSON::Encoder memberEncoder = resultObjectEncoder.makeMember( "jsConstants", 11 );
memberEncoder.makeString( m_jsConstants );
}
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:12,代码来源:Inst.cpp
示例7: toJSONImpl
void ArrayCacheWrapper::toJSONImpl( JSON::ObjectEncoder &objectEncoder ) const
{
{
JSON::Encoder inputEncoder = objectEncoder.makeMember( "input" );
m_inputArrayProducer->toJSON( inputEncoder );
}
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:7,代码来源:ArrayCacheWrapper.cpp
示例8: JSONProduceAsyncUserdata
JSONProduceAsyncUserdata( RC::Handle<ValueProducerWrapper> const &valueProducerWrapper_, int32_t serial )
: valueProducerWrapper( valueProducerWrapper_ )
, notifyJSONArg( new Util::SimpleString )
, notifyJSONArgEncoder( notifyJSONArg )
, notifyJSONArgObjectEncoder( notifyJSONArgEncoder.makeObject() )
{
notifyJSONArgObjectEncoder.makeMember( "serial" ).makeInteger( serial );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:8,代码来源:ValueProducerWrapper.cpp
示例9: toJSONImpl
void ArrayTransformWrapper::toJSONImpl( JSON::ObjectEncoder &objectEncoder ) const
{
{
JSON::Encoder jg = objectEncoder.makeMember( "input" );
m_inputArrayProducer->toJSON( jg );
}
{
JSON::Encoder jg = objectEncoder.makeMember( "operator" );
m_operator->toJSON( jg );
}
if ( m_sharedValueProducer )
{
JSON::Encoder jg = objectEncoder.makeMember( "shared" );
m_sharedValueProducer->toJSON( jg );
}
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:18,代码来源:ArrayTransformWrapper.cpp
示例10: onProgress
void ResourceLoadNode::onProgress( char const *mimeType, size_t done, size_t total, void *userData )
{
if( (size_t)userData != m_streamGeneration )
return;
size_t prevSize = m_fabricResourceStreamData.getDataSize();
if ( total < prevSize )
m_fabricResourceStreamData.resizeData( total );
if( done < total )
{
std::vector<std::string> src;
src.push_back( "DG" );
src.push_back( getName() );
Util::SimpleString json;
{
JSON::Encoder jsonEncoder( &json );
JSON::ObjectEncoder jsonObjectEncoder = jsonEncoder.makeObject();
{
JSON::Encoder memberEncoder = jsonObjectEncoder.makeMember( "received", 8 );
memberEncoder.makeInteger( done );
}
{
JSON::Encoder memberEncoder = jsonObjectEncoder.makeMember( "total", 5 );
memberEncoder.makeInteger( total );
}
}
getContext()->jsonNotify( src, "resourceLoadProgress", 20, &json );
}
else
{
m_fabricResourceStreamData.setMIMEType( mimeType );
m_inProgress = false;//[JeromeCG 20111221] Important: set m_inProgress to false since setResourceData's notifications can trigger an evaluation
setResourceData( NULL, true );
}
}
开发者ID:nikelin,项目名称:PublicStable,代码行数:37,代码来源:ResourceLoadNode.cpp
示例11: appendJSONMembers
void ConstString::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Expr::appendJSONMembers( jsonObjectEncoder, includeLocation );
jsonObjectEncoder.makeMember( "value" ).makeString( m_value );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:5,代码来源:ConstString.cpp
示例12: appendJSONMembers
void ReturnStatement::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Statement::appendJSONMembers( jsonObjectEncoder, includeLocation );
if ( m_expr )
m_expr->appendJSON( jsonObjectEncoder.makeMember( "expr" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:ReturnStatement.cpp
示例13: toJSONImpl
void ConstValueWrapper::toJSONImpl( JSON::ObjectEncoder &objectEncoder ) const
{
JSON::Encoder jg = objectEncoder.makeMember( "data" );
m_unwrapped->getValueDesc()->encodeJSON( m_unwrapped->getImmutableData(), jg );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:5,代码来源:ConstValueWrapper.cpp
示例14: appendJSONMembers
void MemberDecl::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Node::appendJSONMembers( jsonObjectEncoder, includeLocation );
jsonObjectEncoder.makeMember( "name" ).makeString( m_name );
jsonObjectEncoder.makeMember( "type" ).makeString( m_type );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:MemberDecl.cpp
示例15: appendJSONMembers
void AssignOpImpl::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
FunctionBase::appendJSONMembers( jsonObjectEncoder, includeLocation );
jsonObjectEncoder.makeMember( "op" ).makeString( CG::assignOpUserName( m_assignOpType ) );
m_rhs->appendJSON( jsonObjectEncoder.makeMember( "rhs" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:AssignOpImpl.cpp
示例16: appendJSONMembers
void IndexOp::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Expr::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_expr->appendJSON( jsonObjectEncoder.makeMember( "expr" ), includeLocation );
m_indexExpr->appendJSON( jsonObjectEncoder.makeMember( "indexExpr" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:IndexOp.cpp
示例17: appendJSONMembers
void GlobalConstDecl::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Global::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_constDecl->appendJSON( jsonObjectEncoder.makeMember( "constDecl" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:5,代码来源:GlobalConstDecl.cpp
示例18: appendJSONMembers
void CreateConstValue::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Expr::appendJSONMembers( jsonObjectEncoder, includeLocation );
m_child->appendJSON( jsonObjectEncoder.makeMember( "child" ), includeLocation );
}
开发者ID:nikelin,项目名称:PublicStable,代码行数:5,代码来源:CreateConstValue.cpp
示例19: jsonDesc
void SlicedArrayDesc::jsonDesc( JSON::ObjectEncoder &resultObjectEncoder ) const
{
ArrayDesc::jsonDesc( resultObjectEncoder );
resultObjectEncoder.makeMember( "internalType" ).makeString( "slicedArray" );
resultObjectEncoder.makeMember( "memberType" ).makeString( getMemberDesc()->getUserName() );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:SlicedArrayDesc.cpp
示例20: appendJSONMembers
void VarDeclStatement::appendJSONMembers( JSON::ObjectEncoder const &jsonObjectEncoder, bool includeLocation ) const
{
Statement::appendJSONMembers( jsonObjectEncoder, includeLocation );
jsonObjectEncoder.makeMember( "baseType" ).makeString( m_baseType );
m_varDecls->appendJSON( jsonObjectEncoder.makeMember( "varDecls" ), includeLocation );
}
开发者ID:EgoIncarnate,项目名称:fe-devel,代码行数:6,代码来源:VarDeclStatement.cpp
注:本文中的json::ObjectEncoder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论