• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ package函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中package函数的典型用法代码示例。如果您正苦于以下问题:C++ package函数的具体用法?C++ package怎么用?C++ package使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: package

int Download::order() const
{
    if (!package())
        return 0;

    return package()->downloads().indexOf(Qp::sharedFrom(this));
}
开发者ID:lbproductions,项目名称:MorQ,代码行数:7,代码来源:download.cpp


示例2: send_pack

int send_pack(int sfd, char *src_mac, int ifindex, struct in_addr *src, struct in_addr *dst)
{
    send_arping_t sbuf;
    int ret;
    struct sockaddr_ll to;
    memset(&sbuf, 0, sizeof(send_arping_t));

    package(sbuf.ehdr.h_dest, 0xFF, ETH_ALEN);
    memcpy(sbuf.ehdr.h_source, src_mac, ETH_ALEN);
    sbuf.ehdr.h_proto = htons(ETH_P_ARP);
    sbuf.ahdr.ar_hrd = htons(ARPHRD_ETHER);
    sbuf.ahdr.ar_pro = htons(ETH_P_IP);
    sbuf.ahdr.ar_hln = ETH_ALEN;
    sbuf.ahdr.ar_pln = 4;
    sbuf.ahdr.ar_op = htons(ARPOP_REQUEST);

    memcpy(sbuf.src_hw, src_mac, ETH_ALEN);    
    sbuf.src_ip = *src;
    package(sbuf.dst_hw, 0xFF, ETH_ALEN);
    sbuf.dst_ip = *dst;
    package(sbuf.trailer, htons(0), sizeof(sbuf.trailer));

    to.sll_family = AF_PACKET;
    memcpy(to.sll_addr, sbuf.ehdr.h_dest, ETH_ALEN);
    to.sll_halen = ETH_ALEN;
    to.sll_ifindex = ifindex;

    ret = sendto(sfd, &sbuf, sizeof(sbuf), 0, (struct sockaddr*)&to, sizeof(to));
    if (ret != sizeof(sbuf)) {
        perror("sendto:");
        return -1;
    }

    return 0;
}
开发者ID:rongc5,项目名称:test,代码行数:35,代码来源:arp_attack2.c


示例3: package

SErrorPackage PostgresErrorHandler::handle(const QSqlError &error)
{
// 	new row for relation "doms_persons" violates check constraint doms_persons_email_check
// 	insert or update on table "doms_pacients" violates foreign key constraint "doms_pacients_iddocument_fkey"
	
	QString text = error.databaseText().toLower();
	
	if ( text.contains("duplicate key") )
	{
		SErrorPackage package(error.number(), QObject::tr("Seems like pacients already exists"));
		
		return package;
	}
	else if ( text.contains("syntax error") )
	{
		SErrorPackage package(error.number(), QObject::tr("You're trying to do an invalid action"));
		
		return package;
	}
	
	SErrorPackage package(error.number(), QObject::tr("PostgresErrorHandler %1").arg(error.databaseText()));
	
	// TODO: Analizar los textos!
	return package;
}
开发者ID:BackupTheBerlios,项目名称:qapital-svn,代码行数:25,代码来源:postgreserrorhandler.cpp


示例4: get

	docstring const get(string const & m) const
	{
		if (m.empty())
			return from_ascii(m);

		char * o = setlocale(LC_ALL, 0);
		string old;
		if (o)
			old = o;
		char * n = setlocale(LC_ALL, lang_.c_str());
		if (!n)
			// If we are unable to honour the request we just
			// return what we got in.
			return from_ascii(m);
		errno = 0;
		string const locale_dir = package().locale_dir().toFilesystemEncoding();
		char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
		int e = errno;
		if (e) {
			LYXERR(Debug::DEBUG, "Messages::get()" << '\n'
				<< "Error code: " << errno << '\n'
				<< "Lang, mess: " << lang_ << " " << m << '\n'
				<< "Directory : " << package().locale_dir().absFileName() << '\n'
				<< "Rtn value : " << c);
		}

		if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
			LYXERR(Debug::DEBUG, "Messages::get()" << '\n'
				<< "Error code: " << errno << '\n'
				<< "Codeset   : " << ucs4_codeset << '\n');
		}

		textdomain(PACKAGE);

		char const * tmp = m.c_str();
		char const * msg = gettext(tmp);
		docstring translated;
		if (!msg) {
			lyxerr << "Undefined result from gettext" << endl;
			translated = from_ascii(tmp);
		} else if (msg == tmp) {
			//lyxerr << "Same as entered returned" << endl;
			translated = from_ascii(tmp);
		} else {
			LYXERR(Debug::DEBUG, "We got a translation");
			char_type const * ucs4 = reinterpret_cast<char_type const *>(msg);
			translated = ucs4;
		}
		setlocale(LC_ALL, old.c_str());
		return translated;
	}
开发者ID:bsjung,项目名称:Lyx,代码行数:51,代码来源:Messages.cpp


示例5: boxIdFor

    uint32_t boxIdFor(const std::vector<Type> &genericArguments) {
        auto genericId = genericIds_.find(genericArguments);
        if (genericId != genericIds_.end()) {
            return genericId->second;
        }
        auto id = package()->app()->boxObjectVariableInformation().size();
        genericIds_.emplace(genericArguments, id);
        package()->app()->boxObjectVariableInformation().emplace_back();

//        for (auto variable : instanceScope().map()) {
//            variable.second.type().objectVariableRecords(variable.second.id(), &boxObjectVariableInformation_.back());
//        }
        // TODO: fix
        return static_cast<uint32_t>(id);
    }
开发者ID:orochisam,项目名称:emojicode,代码行数:15,代码来源:ValueType.hpp


示例6: memcpy

void SMWServer::playerCreatesRoom(uint64_t playerID, const void* data)
{
    if (!players.count(playerID))
        return;

    Player* player = &players[playerID];
    if (player->currentRoomID || player->isPlaying)
        return;

    // input
    NewRoomPackage pkg;
    memcpy(&pkg, data, sizeof(NewRoomPackage));

    // create
    Room room(roomCreateID, pkg.name, pkg.password, player);
    room.setGamemode(pkg.gamemodeID, pkg.gamemodeGoal);
    rooms[roomCreateID] = room;

    player->currentRoomID = roomCreateID;
    player->isPlaying = false;

    // output
    NewRoomCreatedPackage package(roomCreateID);
    player->sendData(&package, sizeof(NewRoomCreatedPackage));

    log("New room by %s : {id: %d; name: %s; pw: %s}",
        player->toString().c_str(), room.roomID, room.name, room.password);

    roomCreateID++; // increase global ID
}
开发者ID:Fordi,项目名称:supermariowar,代码行数:30,代码来源:server.cpp


示例7: package

EXPORT_C void CSchSendTestUtils::ChangeMessageTimeL(TMsvId aMessage, TTime aTime)
	{
	iMsvEntry->SetEntryL(aMessage);
	TMsvEntry entry = iMsvEntry->Entry();
	iRTest<<entry.iDate<<aTime;
	entry.iDate = aTime;

	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
	wait->Start();
	CMsvOperation*  opert = iMsvEntry->ChangeL(entry, wait->iStatus);
	CleanupStack::PushL(opert);
	CActiveScheduler::Start(); // operation complete
	entry = iMsvEntry->Entry();
	iRTest<<entry.iDate;

	TMsvLocalOperationProgress details;
	TPckgC<TMsvLocalOperationProgress> package(details);	
	package.Set(opert->ProgressL());

	if(wait->iStatus.Int()!=KErrNone)
		User::Leave(wait->iStatus.Int());

	//TInt err = package().iError;
	//if(err != KErrNone);
	//	User::Leave(package().iError);

	CleanupStack::PopAndDestroy(2);//opert, wait
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:28,代码来源:t_schsendutils.cpp


示例8: DRMLOG

// -----------------------------------------------------------------------------
// RDRMRightsClient::GetDomainROL
// Get domain rights object xml representation from the rdb
// -----------------------------------------------------------------------------
//
EXPORT_C HBufC8* RDRMRightsClient::GetDomainROL( const TDesC8& aRoId )
    {
    DRMLOG( _L( "RDRMRightsClient::GetDomainROL" ) );

    // Check the parameter.
    if ( aRoId.Length() )
        {
        TInt size = 0;
        TPckg<TInt> package( size );

        // Call the server. Throw an exception in case of an error.
        User::LeaveIfError(
            SendReceive( DRMEngine::EGetDomainRO,
                         TIpcArgs( &package, &aRoId ) ) );

        HBufC8* roData = HBufC8::NewMaxLC( size );

        // Package 'object' into TPtr8.
        TPtr8 objectPkg( const_cast< TUint8* >( roData->Ptr() ),
                         size,
                         size );

        User::LeaveIfError(
            SendReceive( DRMEngine::EGetPreparedData,
                         TIpcArgs( &objectPkg) ) );
        CleanupStack::Pop( roData ); // roData
        return roData;
        }

    User::Leave( KErrArgument );

    // Never reached.
    return NULL;
    };
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:39,代码来源:DRMRightsClient.cpp


示例9: qDebug

void PackageManager::uninstallMarkedPackages(bool simulate, bool autoremove)
{
#ifdef PACKAGEMANAGER_LOG
    qDebug() << Q_FUNC_INFO << simulate << autoremove;
#endif
    QList<Package*> packageList = m_installedPackagesModel->packageMarkings()->packagesMarked();
    QStringList packageIDs;

    if (packageList.count() == 0)
        return;

    foreach (Package *package, packageList) {
        packageIDs <<  package->id();
    }
    PackageKit::Transaction *t = new PackageKit::Transaction(this);
    m_packManContext.setUninstallPackagesTransaction(new TransactionWrapper(t, true, this));

    connect(t, SIGNAL(package(QSharedPointer<PackageKit::Package>)),
            this, SLOT(onPackage(QSharedPointer<PackageKit::Package>)));

    connect(t, SIGNAL(finished(PackageKit::Transaction::Exit,uint)),
            this, SLOT(onFinished(PackageKit::Transaction::Exit,uint)));

    if (simulate) {
        m_packagesToBeInstalled.clear();
        m_packagesToBeUpdated.clear();
        m_packagesToBeRemoved.clear();
        //   t->simulateRemovePackages(packagePtrList, autoremove);
    } else {
        t->removePackages(packageIDs, false, autoremove);
    }
}
开发者ID:nemomobile,项目名称:qmlpackagemanager,代码行数:32,代码来源:packagemanager.cpp


示例10: package

//protected
string IBroker::askIoTIp()
{	
	string iotIp = "";
	IoTPackage package(this->protocolVersion, "0", "0", NULL);
	TcpClient client(this->ManagerIp, this->ManagerServerPort, 1000);
	
	std::vector<char>recvBuffer;
	recvBuffer.reserve(1000);

	client.Connect();
	if (client.IsConnected)
	{
		client.SendData(&package.DataVectorForSending);
		while (1)
		{
			client.RecviveData(&recvBuffer);
			if (recvBuffer.size() > 0)
			{
				this->parseReceivedBuffer(&iotIp, &recvBuffer);				
				if (iotIp.size() > 0 && this->managerIoTIp.size() > 0)
					break;
			}
			
		}
	}
	client.Disconnect();
	return iotIp;
}
开发者ID:TSIoT,项目名称:IoTRepublicPlus,代码行数:29,代码来源:IBroker.cpp


示例11: package

//
// RTrkTcbCliSession::CloseFile()
//
// Closes data into the already opened file.
// @return KErrNone - if succesful
//		   Negative - if failed.
//
TInt RTrkTcbCliSession::CloseFile(const TTime& aTime)
{
	TPckg<TTime> package(aTime);
	TIpcArgs args(&package);
	
	return SendReceive(ETrkTcbCmdCodeCloseFile, args);
}
开发者ID:fedor4ever,项目名称:devicedbgsrvs,代码行数:14,代码来源:TrkTcbCliSession.cpp


示例12: package

// -----------------------------------------------------------------------------
// RRoapStorageClient::DeleteExpiredRIsL
// -----------------------------------------------------------------------------
//
EXPORT_C void Roap::RRoapStorageClient::DeleteExpiredRIsL( const TTime& aTime )
    {
    TPckg<TTime> package( aTime );

    User::LeaveIfError( SendReceive( Roap::EDeleteExpiredRIs, TIpcArgs(
        &package ) ) );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:11,代码来源:RoapStorageClient.cpp


示例13: package

void
ScreenManager::update(float delta, const std::vector<Input::Event>& events)
{
  ScreenManagerUpdatePackage package(this, get_current_screen(), delta, events);
  ScreenManagerUpdatePackage* pp = &package;
  ceu_out_go(&CEUapp, CEU_IN_SCREEN_MANAGER_UPDATE, &pp);  
}
开发者ID:Tkachov,项目名称:ceu_pingus,代码行数:7,代码来源:screen_manager.cpp


示例14: javaSource

void UmlArtifact::roundtrip_java()
{
    if (! managed) {
        managed = TRUE;

        if (stereotype() != "source")
            return;

        const WrapperStr srcdef = javaSource();

        if (srcdef.isEmpty())
            return;

        const WrapperStr & name = UmlArtifact::name();
        UmlPackage * pack = package();
        WrapperStr src_path = pack->java_path(name);

        {
            WrapperStr s = " <i> " + src_path + "</i>";

            UmlCom::message(name);

            if (verbose())
                UmlCom::trace(WrapperStr("<hr><font face=helvetica>roundtrip body from")
                              + s + "</font><br>");
            else
                set_trace_header(WrapperStr("<font face=helvetica>roundtrip body from")
                                 + s + "</font><br>");
        }

        UmlOperation::roundtrip(src_path, javaLanguage);
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:33,代码来源:UmlArtifact.cpp


示例15: package

void PlasmoidWrapper::setApplet(QObject *extender)
{
    Plasma::Extender *appletExtender = static_cast<Plasma::Extender *>(extender);

    if(appletExtender){
        Plasma::Applet *applet = appletExtender->applet();
        if(applet){

            Plasma::PackageStructure::Ptr structure = Plasma::Applet::packageStructure();
            const QString workflowPath = KGlobal::dirs()->locate("data", structure->defaultPackageRoot() + "/workflow/");
            Plasma::Package package(workflowPath, structure);

            m_version = package.metadata().version();
            emit versionChanged(m_version);

            m_popupApplet = static_cast<Plasma::PopupApplet *>(applet);

            if(m_popupApplet->containment()){
                m_isInPanel = (m_popupApplet->containment()->containmentType() == Plasma::Containment::PanelContainment);
                emit isInPanelChanged(m_isInPanel);

                connect(m_popupApplet,SIGNAL(geometryChanged()),this,SLOT(geometryChangedSlot()));

                connect(KWindowSystem::self(),SIGNAL(activeWindowChanged(WId)),this,SLOT(activeWindowChangedSlot(WId)));
            }
        }

        delete extender;
    }
}
开发者ID:psifidotos,项目名称:workflow-project,代码行数:30,代码来源:plasmoidwrapper.cpp


示例16: package

QString PlasmoidHandler::description(const QString &entry) const
{
    const QString key = m_fileDefinitions.key(entry);

    if (key.isEmpty()) {
        for (const auto dir : package().directories()) {
            if (qstrcmp(entry.toLocal8Bit().data(), dir) == 0) {
                return package().name(entry.toLocal8Bit().data());
            }
        }
    } else {
        return package().name(key.toLocal8Bit().data());
    }

    return QString();
}
开发者ID:KDE,项目名称:plasma-sdk,代码行数:16,代码来源:plasmoidhandler.cpp


示例17: package

//
// RTrkSrvCliSession::GetDebugConnStatus()
//
TInt RTrkSrvCliSession::GetDebugConnStatus(TTrkConnStatus& aConnStatus, TDes& aConnMsg)
{    
    TPckg<TTrkConnStatus> package(aConnStatus);
	TIpcArgs args(&package, aConnMsg.Length(), &aConnMsg);
	
	return SendReceive(ETrkSrvCmdGetDebugConnStatus, args);
}
开发者ID:fedor4ever,项目名称:devicedbgsrvs,代码行数:10,代码来源:trksrvclisession.cpp


示例18: package

void PeerObject::readPackage()
{
	// 	static int readCount	=	0;
	// 	m_dbgLog.write("PeerObject::readData()");
	// 	m_dbgLog.write(QString("(%1)\n").arg(++readCount).toLatin1());
	// 	m_dbgLog.flush();

	static quint64	totalRead	=	0;

	QByteArray	package(m_socket->read().toByteArray());

	if(package.isEmpty()) {
		qDebug("Peer: PeerObject::readPackage() - zero size data");

		m_peerSocket->write(QStringLiteral("fReceived zero size").toLatin1());
// 		m_peerSocket->flush();

		if(m_close)
			close(1);

		return;
	}

	QWriteLocker		writeLocker(&m_dataPkgLock);
	m_dataPkg.append(package);

	static int totalReadPkgCount	=	0;
	totalReadPkgCount++;
	Logger::log("Handled packages", totalReadPkgCount);

	callSlotQueued(this, "checkReadData");
}
开发者ID:HardcorEViruS,项目名称:MessageBus,代码行数:32,代码来源:testlocalsocket_external_peer_object.cpp


示例19: printf

void SMWServer::playerCreatesRoom(uint64_t playerID, const void* data, size_t dataLength)
{
    if (!players.count(playerID))
        return;

    Player* player = &players[playerID];
    if (player->currentRoomID || player->isPlaying)
        return;

    if (dataLength != sizeof(NetPkgs::NewRoom)) {
        printf("[error] Corrupt package arrived from %lu\n", playerID);
        return;
    }

    // input
    NetPkgs::NewRoom pkg;
    memcpy(&pkg, data, dataLength);

    // create
    Room room(roomCreateID, pkg.name, pkg.password, player);
    room.setGamemode(pkg.gamemodeID, pkg.gamemodeGoal);
    rooms[roomCreateID] = room;

    player->currentRoomID = roomCreateID;
    player->isPlaying = false;

    // output
    NetPkgs::NewRoomCreated package(roomCreateID);
    player->sendData(&package, sizeof(NetPkgs::NewRoomCreated));

    log("New room by %s : {id: %d; name: %s; pw: %s}",
        player->toString().c_str(), room.roomID, room.name, room.password);

    roomCreateID++; // increase global ID
}
开发者ID:MisterTea,项目名称:supermariowar,代码行数:35,代码来源:server.cpp


示例20: assert

void Room::sendChatMessage(Player* sender, const char* message)
{
    if (!message)
        return;

    if (strlen(message) <= 0)
        return;

    // TODO: verify
    uint8_t senderNum = 255;
    for (uint8_t p = 0; p < 4 && senderNum == 255; p++) {
        if (players[p] == sender) {
            senderNum = p;
        }
    }
    assert(senderNum != 255);

    NetPkgs::RoomChatMsg package(senderNum, message);

    // Send every player information about the other players.
    for (uint8_t p = 0; p < 4; p++) {
        if (players[p]) {
            players[p]->sendData(&package, sizeof(NetPkgs::RoomChatMsg));
        }
    }
}
开发者ID:carstene1ns,项目名称:supermariowar,代码行数:26,代码来源:Room.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ packet_add_tlv_string函数代码示例发布时间:2022-05-30
下一篇:
C++ packTileID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap