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


C++ StrList::empty方法代码示例

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


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

示例1: Message

FileSystemPile *FileSystemActor::pileize()
{
	StrList dirListing;
	QString dirPath;
	vector<Actor *> objListing;
	FileSystemActor *obj = NULL;
	FileSystemPile *p = NULL;

	// Don't allow Piles to be created recursively
	if (isParentType(BumpPile))
	{
		MessageClearPolicy clearPolicy;
			clearPolicy.setTimeout(4);
		scnManager->messages()->addMessage(new Message("pileize_recPiles", QT_TR_NOOP("Sorry, Items within Piles cannot be viewed as Piles at this time.\nThis feature will be implemented in a later version of BumpTop"), Message::Ok, clearPolicy));
		return NULL;
	}

	// If this item has been pileized, then just return its pile
	if (pileizedPile)
	{
		return pileizedPile;
	}

	if (isFileSystemType(Folder))
	{
		// Get a Directory listing of this folder
		dirPath = getTargetPath();
		dirListing = fsManager->getDirectoryContents(dirPath);

		// Check if this Folder has anything in it
		if (dirListing.empty())
		{
			MessageClearPolicy clearPolicy;
				clearPolicy.setTimeout(4);
			scnManager->messages()->addMessage(new Message("pileize_emptyFolder", QT_TR_NOOP("This folder is empty, so it can't be expanded to a pile"), Message::Ok, clearPolicy));
			return NULL;
		}

		// Create a new Pile
		p = new FileSystemPile();
		if (p)
		{
			for (uint i = 0; i < dirListing.size(); i++)
			{
				obj =  FileSystemActorFactory::createFileSystemActor(dirListing[i]);

				// Create new Actors that represent each item in that directory
				// NOTE: we need to set the initial size of the object, since we try and sync the post it
				//		 in the setFilePath call, which means that it will try and fill to the dims of the
				//		 object, which, in it's default size, is not visible text-wise.
				if (_prevPileizedActorDims.contains(dirListing[i].toLower()))
					obj->setDims(Vec3(_prevPileizedActorDims.value(dirListing[i].toLower())));
				else
					obj->setDims(getDims());
				obj->setGlobalPose(getGlobalPose());
				obj->setFilePath(dirListing[i]);

				objListing.push_back(obj);
			}

			// Add items to this Pile
			for (uint i = 0; i < objListing.size(); i++)
			{
				p->addToPile(objListing[i]);
			}

			// Save and setup initial states
			p->setOwner(this);
			p->setText(getFullText());
			p->stack(getGlobalPosition());
			
			// set the icon to be this actor's 
			if (isFileSystemType(Folder))
				p->setTextIcon(getTextureID());

			// Create custom Animations
			for (uint i = 0; i < objListing.size(); i++)
			{
				objListing[i]->setAlphaAnim(0.0f, 1.0f, 15);
			}

			// Make this actor Non-existent
			this->hideAndDisable();

			// Finish up by setting the pile as the current selection
			pileizedPile = p;
			sel->remove((BumpObject *) this);
			sel->add((Pile *) p);

			textManager->invalidate();

			// record this pilization
			statsManager->getStats().bt.interaction.piles.pilized++;
			return p;
		}		
	}

	return NULL;
}
开发者ID:DX94,项目名称:BumpTop,代码行数:99,代码来源:BT_FileSystemActor.cpp


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