当前位置: 首页>>代码示例>>C++>>正文


C++ PyDict::SetItemString方法代码示例

本文整理汇总了C++中PyDict::SetItemString方法的典型用法代码示例。如果您正苦于以下问题:C++ PyDict::SetItemString方法的具体用法?C++ PyDict::SetItemString怎么用?C++ PyDict::SetItemString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyDict的用法示例。


在下文中一共展示了PyDict::SetItemString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PyDict

PyDict *SimpleSystemEntity::MakeSlimItem() const {
	PyDict *slim = new PyDict();
	slim->SetItemString("typeID", new PyInt(data.typeID));
	slim->SetItemString("ownerID", new PyInt(1));
	slim->SetItemString("itemID", new PyInt(data.itemID));
	return slim;
}
开发者ID:Bes666,项目名称:Evemu,代码行数:7,代码来源:SystemEntities.cpp

示例2: PyDict

PyDict *ItemSystemEntity::MakeSlimItem() const {
	PyDict *slim = new PyDict();
	slim->SetItemString("itemID", new PyInt(Item()->itemID()));
	slim->SetItemString("typeID", new PyInt(Item()->typeID()));
	slim->SetItemString("ownerID", new PyInt(Item()->ownerID()));
	return(slim);
}
开发者ID:Logomorph,项目名称:evemu_crucible,代码行数:7,代码来源:SystemEntity.cpp

示例3: PyDict

PyObject *DBRowToRow(DBResultRow &row, const char *type)
{

    PyDict *args = new PyDict();
    PyObject *res = new PyObject( type, args );

    //list off the column names:
    uint32 cc = row.ColumnCount();
    PyList *header = new PyList(cc);
    args->SetItemString("header", header);

    for(uint32 r = 0; r < cc; r++) {
        header->SetItemString(r, row.ColumnName(r));
    }

    //lines:
    PyList *rowlist = new PyList(cc);
    args->SetItemString("line", rowlist);

    //add a line entry for the row:
    for(uint32 r = 0; r < cc; r++) {
        rowlist->SetItem(r, DBColumnToPyRep(row, r));
    }

    return res;
}
开发者ID:Ahava,项目名称:evemu_server,代码行数:26,代码来源:EVEDBUtils.cpp

示例4: _CreateKeywords

PyDict* UserError::_CreateKeywords( const char* msg )
{
    PyDict* keywords = new PyDict;
    keywords->SetItemString( "msg", new PyString( msg ) );
    keywords->SetItemString( "dict", new PyDict );

    return keywords;
}
开发者ID:eve-moo,项目名称:evemu_server,代码行数:8,代码来源:PyExceptions.cpp

示例5: codelog

//this is a crap load of work... there HAS to be a better way to do this..
PyRep *MarketDB::GetMarketGroups() {
    
    DBQueryResult res;
    DBResultRow row;

    if(!sDatabase.RunQuery(res,
        "SELECT * "
        " FROM invMarketGroups"))
    {
        codelog(MARKET__ERROR, "Error in query: %s", res.error.c_str());
        return NULL;
    }

	DBRowDescriptor *header = new DBRowDescriptor(res);
    
    CFilterRowSet *filterRowset = new CFilterRowSet(&header);
    
    PyDict *keywords = filterRowset->GetKeywords();
	keywords->SetItemString("giveMeSets", new PyBool(false)); //+
	keywords->SetItemString("allowDuplicateCompoundKeys", new PyBool(false)); //+
	keywords->SetItemString("indexName", new PyNone); //+
	keywords->SetItemString("columnName", new PyString("parentGroupID")); //+
    std::map< int, PyRep* > tt;

    while( res.GetRow(row) )
    {
        int parentGroupID = ( row.IsNull( 0 ) ? -1 : row.GetUInt( 0 ) );
        PyRep *pid;
        CRowSet *rowset;
        if(tt.count(parentGroupID) == 0) {
            pid = parentGroupID!=-1 ? (PyRep*)new PyInt(parentGroupID) : (PyRep*)new PyNone();
            tt.insert( std::pair<int, PyRep*>(parentGroupID, pid) );
            rowset = filterRowset->NewRowset(pid);
        } else {
            pid = tt[parentGroupID];
            rowset = filterRowset->GetRowset(pid);
        }
        
        PyPackedRow* pyrow = rowset->NewRow();

        pyrow->SetField((uint32)0, pid); //prentGroupID
        pyrow->SetField(1, new PyInt(row.GetUInt( 1 ) ) ); //marketGroupID
        pyrow->SetField(2, new PyString(row.GetText( 2 ) ) ); //marketGroupName
        pyrow->SetField(3, new PyString(row.GetText( 3 ) ) ); //description
        pyrow->SetField(4, row.IsNull( 4 ) ? 
            (PyRep*)(new PyNone()) : new PyInt(row.GetUInt( 4 ))  ); //graphicID
        pyrow->SetField(5, new PyBool(row.GetBool( 5 ) ) ); //hasTypes
        pyrow->SetField(6, row.IsNull( 6 ) ? 
            (PyRep*)(new PyNone()) : new PyInt(row.GetUInt( 6 ))  ); // iconID 
        pyrow->SetField(7, new PyInt( row.GetUInt(7) )  ); //dataID
        pyrow->SetField(8, new PyInt( row.GetUInt(8) )  ); //marketGroupNameID
        pyrow->SetField(9, new PyInt( row.GetUInt(9) )  ); //descriptionID
    }

    return filterRowset;
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:57,代码来源:MarketDB.cpp

示例6: _CreateKeywords

PyDict* CFilterRowSet::_CreateKeywords(DBRowDescriptor* rowDesc)
{
    assert( rowDesc );

    PyDict* keywords = new PyDict;
    keywords->SetItemString( "header", rowDesc );
    keywords->SetItemString( "columnName", rowDesc->GetColumnName(0) );


    return keywords;
}
开发者ID:Almamu,项目名称:evemu_server,代码行数:11,代码来源:PyDatabase.cpp

示例7: GetFacWarSystems

PyRep* FactionWarMgrDB::GetFacWarSystems()
{
    sLog.Debug( "FactionWarMgrDB", "Called GetFacWarSystems stub." );

	//fill some crap
	PyDict* result = new PyDict;
	PyDict* dict;

	dict = new PyDict;
	dict->SetItemString( "occupierID", new PyInt( 500002 ) );
	dict->SetItemString( "factionID", new PyInt( 500002 ) );
	result->SetItem( new PyInt( 30002097 ), dict );

	return result;
}
开发者ID:MurdockGT,项目名称:evemu-incursion,代码行数:15,代码来源:FactionWarMgrDB.cpp

示例8: _CreateKeywords

PyDict* CRowSet::_CreateKeywords(DBRowDescriptor* rowDesc)
{
	assert( rowDesc );

	PyDict* keywords = new PyDict;
	keywords->SetItemString( "header", rowDesc );

	uint32 cc = rowDesc->ColumnCount();
	PyList* columns = new PyList( cc );
	for( uint32 i = 0; i < cc; i++ )
		columns->SetItem( i,  new PyString( *rowDesc->GetColumnName( i ) ) );
	keywords->SetItemString( "columns", columns );

	return keywords;
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:15,代码来源:PyDatabase.cpp

示例9: PyIncRef

PyDict *SystemStargateEntity::MakeSlimItem() const {
	PyDict *slim = SystemStationEntity::MakeSlimItem();
    if(m_jumps != NULL) {
        PyIncRef(m_jumps);
		slim->SetItemString("jumps", m_jumps);
    }
	return slim;
}
开发者ID:Bes666,项目名称:Evemu,代码行数:8,代码来源:SystemEntities.cpp

示例10: PyString

PyObject *DBResultToIndexRowset(DBQueryResult &result, uint32 key_index) {
    uint32 cc = result.ColumnCount();

    //start building the IndexRowset
    PyDict *args = new PyDict();
    PyObject *res = new PyObject(
        new PyString( "util.IndexRowset" ), args
    );

    if(cc == 0 || cc < key_index)
        return res;
    
    //list off the column names:
    PyList *header = new PyList(cc);
    args->SetItemString("header", header);
    for(uint32 i = 0; i < cc; i++)
        header->SetItemString(i, result.ColumnName(i));

    //RowClass:
    args->SetItemString("RowClass", new PyToken("util.Row"));
    //idName:
    args->SetItemString("idName", new PyString( result.ColumnName(key_index) ));

    //items:
    PyDict *items = new PyDict();
    args->SetItemString("items", items);

    //add a line entry for each result row:
    DBResultRow row;
    while(result.GetRow(row)) {
        PyRep *key = DBColumnToPyRep(row, key_index);

        PyList *line = new PyList(cc);
        for(uint32 i = 0; i < cc; i++)
            line->SetItem(i, DBColumnToPyRep(row, i));

        items->SetItem(key, line);
    }

    return res;
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:41,代码来源:EVEDBUtils.cpp

示例11: Handle_UpdateBulk

PyResult BulkMgrService::Handle_UpdateBulk(PyCallArgs &call)
{
    Call_UpdateBulk args;
    if(!args.Decode(&call.tuple)) {
        codelog(CLIENT__ERROR, "Invalid arguments");
	return NULL;
    }

    PyDict* test = new PyDict();
    test->SetItemString("type", new PyInt(updateBulkStatusOK));
    test->SetItemString("allowUnsubmitted", new PyBool(false));

    return test;
}
开发者ID:Ahava,项目名称:evemu_server,代码行数:14,代码来源:BulkMgrService.cpp

示例12: Handle_SyncMail

PyResult MailMgrService::Handle_SyncMail(PyCallArgs &call)
{
    int firstId = 0, secondId = 0;

    if (call.tuple->size() == 2 && !call.tuple->GetItem(0)->IsNone() && !call.tuple->GetItem(1)->IsNone())
    {
        Call_TwoIntegerArgs args;
        if (!args.Decode(&call.tuple))
        {
            codelog(CLIENT__ERROR, "Failed to decode SyncMail args");
            return NULL;
        }

        // referring to a mail id range
        int firstId = args.arg1, secondId = args.arg2;
    }

    PyDict* dummy = new PyDict;
    dummy->SetItemString("oldMail", new PyNone());
    dummy->SetItemString("newMail", m_db->GetNewMail(call.client->GetCharacterID()));
    dummy->SetItemString("mailStatus", m_db->GetMailStatus(call.client->GetCharacterID()));
    return new PyObject("util.KeyVal", dummy);
}
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:23,代码来源:MailMgrService.cpp

示例13: Handle_NumRequiringAttention

PyResult ContractMgrService::Handle_NumRequiringAttention( PyCallArgs& call )
{
	uint32 requiresAttentionCorp = 0;
	uint32 requiresAttention = 0;

	std::map<uint32, ContractRef>::const_iterator cur, end;
	std::map<uint32, ContractRef> contracts = m_contractManager->GetContractList();

	cur = contracts.begin();
	end = contracts.end();

	for(; cur != end; cur++ )
	{
		ContractRef contract = cur->second;
		if( contract->requiresAttention() )
		{
			if( contract->issuerCorpID() == call.client->GetCorporationID() )
			{
				requiresAttentionCorp += 1;
			}else if( contract->issuerID() == call.client->GetCharacterID() ){
				requiresAttention += 1;
			}else if( contract->acceptorID() == call.client->GetCharacterID() ){
				requiresAttention += 1;
			}else if( contract->assigneeID() == call.client->GetCharacterID() ){
				requiresAttention += 1;
			}
		}
	}

	PyDict* args = new PyDict;
	args->SetItemString( "n", new PyInt( requiresAttention ) );
	args->SetItemString( "ncorp", new PyInt( requiresAttentionCorp ) );

	return new PyObject(
        new PyString( "util.KeyVal" ), args
    );
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:37,代码来源:ContractMgrService.cpp

示例14: return

PyDict *SystemStargateEntity::MakeSlimItem() const {
    PyDict *slim = SystemStationEntity::MakeSlimItem();
    if(m_jumps != NULL)
        slim->SetItemString("jumps", m_jumps->Clone());
    return(slim);
}
开发者ID:eve-moo,项目名称:evemu_server,代码行数:6,代码来源:SystemEntities.cpp

示例15: Handle_CollectMyPageInfo

PyResult ContractMgrService::Handle_CollectMyPageInfo( PyCallArgs& call )
{
	PyDict* ret = new PyDict;
	uint32 numOutstandingContractsNonCorp = 0;
	uint32 numOutstandingContractsForCorp = 0;
	uint32 numContractsLeft = 0;
	uint32 numRequiresAttention = 0;
	uint32 numRequiresAttentionCorp = 0;
	uint32 numAssignedTo = 0;
	uint32 numAssignedToCorp = 0;
	uint32 numBiddingOn = 0;
	uint32 numInProgress = 0;
	uint32 numBiddingOnCorp = 0;
	uint32 numInProgressCorp = 0;

	std::map<uint32, ContractRef>::const_iterator cur, end;
	std::map<uint32, ContractRef> contracts = m_contractManager->GetContractList();

	cur = contracts.begin();
	end = contracts.end();

	for(; cur != end; cur++ )
	{
		ContractRef contract = cur->second;
		if( contract->issuerID() == call.client->GetCharacterID() )
		{
			if( contract->forCorp() == true )
			{
				if( contract->requiresAttention() ) numRequiresAttentionCorp += 1;
				if( contract->assigneeID() ) numAssignedToCorp += 1;
				if( contract->status() == conStatusInProgress ) numInProgressCorp += 1;
				numOutstandingContractsForCorp += 1;
			}else{
				if( contract->requiresAttention() ) numRequiresAttention += 1;
				if( contract->assigneeID() ) numAssignedTo += 1;
				if( contract->status() == conStatusInProgress ) numInProgress += 1;
				numOutstandingContractsNonCorp += 1;
			}

		}
	}

	ret->SetItemString( "numOutstandingContractsNonCorp", new PyInt( numOutstandingContractsNonCorp ) );
	ret->SetItemString( "numOutstandingContractsForCorp", new PyInt( numOutstandingContractsForCorp ) );
	ret->SetItemString( "numOutstandingContracts", new PyInt( numOutstandingContractsNonCorp + numOutstandingContractsForCorp ) );
	ret->SetItemString( "numContractsLeft", new PyInt( numContractsLeft ) );
	ret->SetItemString( "numRequiresAttention", new PyInt( numRequiresAttention ) );
	ret->SetItemString( "numRequiresAttentionCorp", new PyInt( numRequiresAttentionCorp ) );
	ret->SetItemString( "numAssignedTo", new PyInt( numAssignedTo ) );
	ret->SetItemString( "numAssignedToCorp", new PyInt( numAssignedToCorp ) );
	ret->SetItemString( "numBiddingOn", new PyInt( numBiddingOn ) );
	ret->SetItemString( "numInProgress", new PyInt( numInProgress ) );
	ret->SetItemString( "numBiddingOnCorp", new PyInt( numBiddingOnCorp ) );
	ret->SetItemString( "numInProgressCorp", new PyInt( numInProgressCorp ) );
	
	return new PyObject(
		new PyString( "util.KeyVal" ), ret 
		);
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:59,代码来源:ContractMgrService.cpp


注:本文中的PyDict::SetItemString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。