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

C++ KVI_ASSERT函数代码示例

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

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



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

示例1: resetInternalStatus

KviHttpRequest::~KviHttpRequest()
{
	resetInternalStatus();

	KVI_ASSERT(!(m_p->pSocket));
	KVI_ASSERT(!(m_p->pFile));

	if(m_p->pBuffer)
		delete m_p->pBuffer;

	delete m_p;
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:12,代码来源:KviHttpRequest.cpp


示例2: KVI_ASSERT

void PopupEditorWidget::getUniquePopupName(MenuTreeWidgetItem * item, QString & buffer)
{
	KVI_ASSERT(m_bOneTimeSetupDone);

	if(buffer.isEmpty())
		buffer = __tr2qs_ctx("unnamed", "editor");
	QString newName = buffer;

	bool bFound = true;
	int idx = 1;
	int topcount = m_pTreeWidget->topLevelItemCount();

	while(bFound)
	{
		bFound = false;

		for(int i = 0; i < topcount; i++)
		{
			MenuTreeWidgetItem * ch = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i);

			if(KviQString::equalCI(newName, ch->m_pPopup->popupName()) && (ch != item))
			{
				bFound = true;
				newName = QString("%1.%2").arg(buffer).arg(idx);
				idx++;
				break;
			}
		}
	}

	buffer = newName;
}
开发者ID:Dessa,项目名称:KVIrc,代码行数:32,代码来源:PopupEditorWindow.cpp


示例3: KVI_ASSERT

void RawEditorWidget::getUniqueHandlerName(RawTreeWidgetItem *it,QString &buffer)
{
	KVI_ASSERT(m_bOneTimeSetupDone);

	QString newName = buffer;
	if(newName.isEmpty())newName = __tr2qs_ctx("unnamed","editor");

	bool bFound = true;
	int idx = 1;

	while(bFound)
	{
		bFound = false;

		for (int i=0;i<it->childCount();i++)
		{
			RawHandlerTreeWidgetItem * ch =(RawHandlerTreeWidgetItem *) it->child(i);
			if(KviQString::equalCI(newName,ch->text(0)))
			{
				bFound = true;
				newName = QString("%1_%2").arg(buffer).arg(idx);
				idx++;
				break;
			}
		}

	}

	buffer = newName;
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:30,代码来源:RawEditorWindow.cpp


示例4: KVI_ASSERT

void EventEditor::getUniqueHandlerName(EventEditorEventTreeWidgetItem *it,QString &buffer)
{
	KVI_ASSERT(m_bOneTimeSetupDone);

	QString newName = buffer;
	if(newName.isEmpty())newName = __tr2qs_ctx("unnamed","editor");

	bool bFound = true;
	int idx = 1;

	while(bFound)
	{
		bFound = false;

		for(int i=0;i<it->childCount();i++)
		//for(EventEditorHandlerTreeWidgetItem * ch = (EventEditorHandlerTreeWidgetItem *)(it->firstChild());ch;ch = (EventEditorHandlerTreeWidgetItem *)ch->nextSibling())
		{
			if(KviQString::equalCI(newName,((EventEditorHandlerTreeWidgetItem *)it->child(i))->m_szName))
			{
				bFound = true;
				newName = QString("%1_%2").arg(buffer).arg(idx);
				idx++;
				break;
			}
		}
	}

	buffer = newName;
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:29,代码来源:EventEditorWindow.cpp


示例5: KVI_ASSERT

void KviHttpRequest::slotSocketReadDataReady()
{
	KVI_ASSERT(m_p->pSocket);

	int iBytes = m_p->pSocket->bytesAvailable();

	if(iBytes <= 0)
	{
		// assume connection closed ?
		slotSocketDisconnected();
		return;
	}

	// FIXME: Avoid double-buffering here!

	KviDataBuffer oBuffer(iBytes);

	int iRead = m_p->pSocket->read((char *)(oBuffer.data()),iBytes);
	if(iRead < iBytes)
	{
		// hum.... what here ?
		if(iRead < 1)
		{
			slotSocketDisconnected();
			return;
		}

		// FIXME
		// well... otherwise just wait.
		// FIXME ?
		oBuffer.resize(iRead);
	}

	processData(&oBuffer);
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:35,代码来源:KviHttpRequest.cpp


示例6: KVI_ASSERT

void KviMdiChild::setClient(QWidget * w)
{
	KVI_ASSERT(!m_pClient);
	KVI_ASSERT(w);

	m_pClient = w;
	setWidget(w);
	QString tmp1;
	if(w->inherits("KviWindow"))
	{
		KviIrcConnection * pConnection=((KviWindow*)w)->connection();
		if(pConnection)
			tmp1.append(pConnection->target()->network()->name()+"_");
	}

	KviCString tmp(KviCString::Format,"mdi_child_%s%s",tmp1.toUtf8().data(),w->objectName().toUtf8().data());
	setObjectName(tmp.ptr());
}
开发者ID:namikaze90,项目名称:KVIrc,代码行数:18,代码来源:KviMdiChild.cpp


示例7: KVI_ASSERT

KviQueryWindow * KviIrcContext::findDeadQuery(const QString & name)
{
	for(auto & q : m_DeadQueries)
	{
		KVI_ASSERT(q->isDeadQuery());
		if(KviQString::equalCI(name, q->windowName()))
			return q;
	}

	return nullptr;
}
开发者ID:AndrioCelos,项目名称:KVIrc,代码行数:11,代码来源:KviIrcContext.cpp


示例8: url_compare_helper

static inline bool url_compare_helper(const kvi_wchar_t * pData1, const kvi_wchar_t * pData2, int iData2Len)
{
	KVI_ASSERT(pData1);
	KVI_ASSERT(pData2);

	// pData1 is null-terminated and may be shorter than pData2
	// pData2 is NOT null terminated and is lower case

	const kvi_wchar_t * pData2End = pData2 + iData2Len;

	while(pData2 < pData2End)
	{
		if(!*pData1)
			return false; // not equal
		if(QChar::toLower(*pData1) != *pData2)
			return false; // not equal
		pData1++;
		pData2++;
	}
	return true; // all equal up to iData2Len
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:21,代码来源:KviIrcView_getTextLine.cpp


示例9: KVI_ASSERT

bool KviIrcView::event(QEvent *e)
{
	if(e->type() == QEvent::User)
	{
		KVI_ASSERT(m_bPostedPaintEventPending);
		if(m_iUnprocessedPaintEventRequests)
			repaint();
		// else we just had a pointEvent that did the job
		m_bPostedPaintEventPending = false;
		return true;
	}
	return QWidget::event(e);
}
开发者ID:Heufneutje,项目名称:KVIrc,代码行数:13,代码来源:KviIrcView_events.cpp


示例10: KVI_ASSERT

void KviKvsObjectController::deleteClass(KviKvsObjectClass * pClass)
{
	KVI_ASSERT(pClass);

	pClass->clearDirtyFlag(); // don't flush it to disk

	QString szPath;
	QString szFileName = pClass->name().toLower();
	szFileName += ".kvs";
	szFileName.replace("::","--");
	g_pApp->getLocalKvircDirectory(szPath,KviApplication::Classes,szFileName);
	KviFileUtils::removeFile(szPath);

	delete pClass;
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:15,代码来源:KviKvsObjectController.cpp


示例11: cfg

void KviRegisteredChannelDataBase::save(const QString &filename)
{
	KviConfigurationFile cfg(filename,KviConfigurationFile::Write);
	cfg.clear();
	cfg.preserveEmptyGroups(true);

	for(QHash<QString,KviRegisteredChannelList *>::Iterator it = m_pChannelDict->begin();it != m_pChannelDict->end();++it)
	{
		KviRegisteredChannelList * l = it.value();
		KVI_ASSERT(l);

		for(KviRegisteredChannel * c = l->first();c;c = l->next())
		{
			QString szGroup = QString::fromUtf8("%[email protected]%2").arg(c->name(),c->netMask());
			cfg.setGroup(szGroup);

			QHash<QString,QString> * pPropertyDict = c->propertyDict();
			KVI_ASSERT(pPropertyDict);

			for(QHash<QString,QString>::Iterator it2 = pPropertyDict->begin();it2 != pPropertyDict->end();++it2)
				cfg.writeEntry(it2.key(),it2.value());
		}
	}
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:24,代码来源:KviRegisteredChannelDataBase.cpp


示例12: kvi_appendWCharToQStringWithLength

void kvi_appendWCharToQStringWithLength(QString * qstrptr, const kvi_wchar_t * ptr, kvi_wslen_t len)
{
	KVI_ASSERT(qstrptr);
	kvi_wslen_t oldLen = qstrptr->length();
	qstrptr->resize(oldLen + len);
#ifdef WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
	KviMemory::copy((void *)(qstrptr->unicode() + oldLen), ptr, sizeof(kvi_wchar_t) * len);
#else  // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
	QChar * c = (QChar *)(qstrptr->unicode() + oldLen);
	while(*ptr)
	{
		c->unicode() = *ptr;
		ptr++;
		c++;
	}
#endif // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:17,代码来源:KviIrcView_getTextLine.cpp


示例13: findExact

void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c)
{
	KviRegisteredChannel * old = findExact(c->name(),c->netMask());

	if(old)
	{
		// merge properties
		QHash<QString,QString> * pPropertyDict = old->propertyDict();
		KVI_ASSERT(pPropertyDict);

		for(QHash<QString,QString>::Iterator it = pPropertyDict->begin();it != pPropertyDict->end();++it)
		{
			if(!c->property(it.key()).isEmpty())
				c->setProperty(it.key(),it.value());
		}

		remove(old);
	}

	KviRegisteredChannelList * l = m_pChannelDict->value(c->name());
	if(!l)
	{
		l = new KviRegisteredChannelList();
		l->setAutoDelete(true);
		m_pChannelDict->insert(c->name(),l);
	}

	// insert where there are less wildcards
	int o = c->netMask().count(QChar('*'));

	int idx = 0;
	for(KviRegisteredChannel * rc = l->first();rc;rc = l->next())
	{
		if(rc->netMask().count(QChar('*')) > o)
		{
			// the existing has more wildcards, insert here!
			l->insert(idx,c);
			return;
		}
		idx++;
	}

	l->append(c);
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:44,代码来源:KviRegisteredChannelDataBase.cpp


示例14: KVI_ASSERT

void EventEditor::itemPressed(QTreeWidgetItem * it, const QPoint & pnt)
{
	KVI_ASSERT(m_bOneTimeSetupDone);

	if(it)
	{
		m_pContextPopup->clear();
		if(it->parent())
		{
			QString tmp;
			if(!(((EventEditorHandlerTreeWidgetItem *)it)->m_bEnabled))
				m_pContextPopup->addAction(
				    *(g_pIconManager->getSmallIcon(KviIconManager::Handler)),
				    __tr2qs_ctx("&Enable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled()));
			else
				m_pContextPopup->addAction(
				    *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)),
				    __tr2qs_ctx("&Disable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled()));

			m_pContextPopup->addAction(
			    *(g_pIconManager->getSmallIcon(KviIconManager::Discard)),
			    __tr2qs_ctx("Re&move Handler", "editor"),
			    this, SLOT(removeCurrentHandler()));
			m_pContextPopup->addAction(
			    *(g_pIconManager->getSmallIcon(KviIconManager::Save)),
			    __tr2qs_ctx("&Export Handler to...", "editor"),
			    this, SLOT(exportCurrentHandler()));
		}
		else
		{
			m_pContextPopup->addAction(
			    *(g_pIconManager->getSmallIcon(KviIconManager::Handler)),
			    __tr2qs_ctx("&New Handler", "editor"),
			    this, SLOT(addHandlerForCurrentEvent()));
		}

		m_pContextPopup->popup(pnt);
	}
}
开发者ID:CardinalSins,项目名称:KVIrc,代码行数:39,代码来源:EventEditorWindow.cpp


示例15: KVI_ASSERT

void KviStupidNotifyListManager::sendIsOn()
{
	m_szLastIsOnMsg = "";
	QString * nick = m_pNickList->at(m_iNextNickToCheck);
	KVI_ASSERT(nick);

	int i = 0;
	while(nick && ((nick->length() + 5 + m_szLastIsOnMsg.length()) < 510))
	{
		KviQString::appendFormatted(m_szLastIsOnMsg, " %Q", nick);
		nick = m_pNickList->next();
		i++;
	}
	if(_OUTPUT_PARANOIC)
		m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Notify list: Checking for: %Q"), &m_szLastIsOnMsg);
	QByteArray dat = m_pConnection->encodeText(m_szLastIsOnMsg);
	m_pConnection->sendFmtData("ISON%s", dat.data());

	if(m_pConnection->lagMeter())
		m_pConnection->lagMeter()->lagCheckRegister("@notify_naive", 20);

	m_iNextNickToCheck += i;
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:23,代码来源:KviNotifyList.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ KVI_OPTION_BOOL函数代码示例发布时间:2022-05-30
下一篇:
C++ KUrl函数代码示例发布时间: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