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


C++ LLString::append方法代码示例

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


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

示例1: refresh

void LLFloaterAvatarTextures::refresh()
{
	LLVOAvatar *avatarp = find_avatar(mID);
	if (avatarp)
	{
		char firstname[DB_FIRST_NAME_BUF_SIZE];	/*Flawfinder: ignore*/
		char lastname[DB_LAST_NAME_BUF_SIZE];		/*Flawfinder: ignore*/
		if (gCacheName->getName(avatarp->getID(), firstname, lastname))
		{
			LLString name;
			name.assign( firstname );
			name.append( " " );
			name.append( lastname );

			setTitle(mTitle + ": " + name);
		}
		update_texture_ctrl(avatarp, mBakedHead,	LLVOAvatar::TEX_HEAD_BAKED);
		update_texture_ctrl(avatarp, mBakedEyes,	LLVOAvatar::TEX_EYES_BAKED);
		update_texture_ctrl(avatarp, mBakedUpper,	LLVOAvatar::TEX_UPPER_BAKED);
		update_texture_ctrl(avatarp, mBakedLower,	LLVOAvatar::TEX_LOWER_BAKED);
		update_texture_ctrl(avatarp, mBakedSkirt,	LLVOAvatar::TEX_SKIRT_BAKED);

		update_texture_ctrl(avatarp, mMakeup,		LLVOAvatar::TEX_HEAD_BODYPAINT);
		update_texture_ctrl(avatarp, mHair,			LLVOAvatar::TEX_HAIR);
		update_texture_ctrl(avatarp, mEye,			LLVOAvatar::TEX_EYES_IRIS);

		update_texture_ctrl(avatarp, mShirt,		LLVOAvatar::TEX_UPPER_SHIRT);
		update_texture_ctrl(avatarp, mUpperTattoo,	LLVOAvatar::TEX_UPPER_BODYPAINT);
		update_texture_ctrl(avatarp, mUpperJacket,	LLVOAvatar::TEX_UPPER_JACKET);
		update_texture_ctrl(avatarp, mGloves,		LLVOAvatar::TEX_UPPER_GLOVES);
		update_texture_ctrl(avatarp, mUndershirt,	LLVOAvatar::TEX_UPPER_UNDERSHIRT);

		update_texture_ctrl(avatarp, mPants,		LLVOAvatar::TEX_LOWER_PANTS);
		update_texture_ctrl(avatarp, mLowerTattoo,	LLVOAvatar::TEX_LOWER_BODYPAINT);
		update_texture_ctrl(avatarp, mShoes,		LLVOAvatar::TEX_LOWER_SHOES);
		update_texture_ctrl(avatarp, mSocks,		LLVOAvatar::TEX_LOWER_SOCKS);
		update_texture_ctrl(avatarp, mJacket,		LLVOAvatar::TEX_LOWER_JACKET);
		update_texture_ctrl(avatarp, mUnderpants,	LLVOAvatar::TEX_LOWER_UNDERPANTS);
		update_texture_ctrl(avatarp, mSkirt,		LLVOAvatar::TEX_SKIRT);
	}
	else
	{
		setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")");
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:45,代码来源:llfloateravatartextures.cpp

示例2: title

// Default constructor
LLFloaterAbout::LLFloaterAbout() 
:	LLFloater("floater_about", "FloaterAboutRect", "")
{
	gUICtrlFactory->buildFloater(this, "floater_about.xml");

	// Support for changing product name.
	LLString title("About ");
	title += gSecondLife;
	setTitle(title);

	LLString support;

	// Version string
	LLString version = gSecondLife
		+ llformat(" %d.%d.%d (%d) %s %s",
				   LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
				   __DATE__, __TIME__);
	support.append(version);
	support.append("\n\n");

	// Position
	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		//XUI:translate
		const LLVector3d &pos = gAgent.getPositionGlobal();
		LLString pos_text = llformat("You are at %.1f, %.1f, %.1f ", 
			pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]);
		support.append(pos_text);

		LLString region_text = llformat("in %s located at ",
				gAgent.getRegion()->getName().c_str());
		support.append(region_text);

		char buffer[MAX_STRING];		/*Flawfinder: ignore*/
		gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING);
		support.append(buffer);
		support.append(" (");
		gAgent.getRegion()->getHost().getString(buffer, MAX_STRING);
		support.append(buffer);
		support.append(")\n\n");
	}

	// CPU
	support.append("CPU: ");
	support.append( gSysCPU.getCPUString() );
	support.append("\n");

	U32 memory = gSysMemory.getPhysicalMemory() / 1024 / 1024;
	// For some reason, the reported amount of memory is always wrong by one meg
	memory++;

	LLString mem_text = llformat("Memory: %u MB\n", memory );
	support.append(mem_text);

	support.append("OS Version: ");
	support.append( gSysOS.getOSString().c_str() );
	support.append("\n");

	support.append("Graphics Card Vendor: ");
	support.append( (const char*) glGetString(GL_VENDOR) );
	support.append("\n");

	support.append("Graphics Card: ");
	support.append( (const char*) glGetString(GL_RENDERER) );
	support.append("\n");

	support.append("OpenGL Version: ");
	support.append( (const char*) glGetString(GL_VERSION) );
	support.append("\n");

#if LL_LIBXUL_ENABLED
	support.append("LLMozLib Version: ");
	support.append( (const char*) LLMozLib::getInstance()->getVersion().c_str() );
	support.append("\n");
#endif // LL_LIBXUL_ENABLED

	if (gViewerStats
		&& gPacketsIn > 0)
	{
		LLString packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", 
			gViewerStats->mPacketsLostStat.getCurrent(),
			F32(gPacketsIn),
			100.f*gViewerStats->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
		support.append(packet_loss);
		support.append("\n");
	}

	// MD5 digest of executable
	support.append("Viewer Digest: ");
	char viewer_digest_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
	gViewerDigest.toString( viewer_digest_string );
	support.append(viewer_digest_string);

	// Fix views
	childDisable("credits_editor");
	childDisable("support_editor");
	childSetText("support_editor", support);

//.........这里部分代码省略.........
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:101,代码来源:llfloaterabout.cpp

示例3: title

// Default constructor
LLFloaterAbout::LLFloaterAbout() 
:	LLFloater("floater_about", "FloaterAboutRect", "")
{
	gUICtrlFactory->buildFloater(this, "floater_about.xml");

	// Support for changing product name.
	LLString title("About ");
	title += LLAppViewer::instance()->getSecondLifeTitle();
	setTitle(title);

	LLString support;

	// Version string
	LLString version = LLAppViewer::instance()->getSecondLifeTitle() 
		+ llformat(" %d.%d.%d.%d Netbook Edition v1.2 %s %s", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, __DATE__, __TIME__);
//MK
	if (RRenabled)
	{
		version += "\n" + gAgent.mRRInterface.getVersion ();
	}
//mk
	support.append(version);
	support.append("\n\n");

	// Position
	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		const LLVector3d &pos = gAgent.getPositionGlobal();
		LLUIString pos_text = childGetText("you_are_at");
		pos_text.setArg("[POSITION]",
						llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
//MK
		if (RRenabled && gAgent.mRRInterface.mContainsShowloc)
		{
			pos_text = "(Position hidden)\n";
		}
//mk
		support.append(pos_text);

		LLString region_text = llformat("in %s located at ",
				gAgent.getRegion()->getName().c_str());
//MK
		if (RRenabled && gAgent.mRRInterface.mContainsShowloc)
		{
			region_text = "(Region hidden)\n";
		}
//mk
		support.append(region_text);

//MK
		if (!RRenabled || !gAgent.mRRInterface.mContainsShowloc)
		{
//mk
			char buffer[MAX_STRING];		/*Flawfinder: ignore*/
			gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING);
			support.append(buffer);
			support.append(" (");
			gAgent.getRegion()->getHost().getString(buffer, MAX_STRING);
			support.append(buffer);
			support.append(")\n");
			support.append(gLastVersionChannel);
			support.append("\n\n");
//MK
		}
		else
		{
			support.append ("(Server info hidden)\n\n");
		}
//mk
	}

	//*NOTE: Do not translate text like GPU, Graphics Card, etc -
	//  Most PC users that know what these mean will be used to the english versions,
	//  and this info sometimes gets sent to support
	
	// CPU
	support.append("CPU: ");
	support.append( gSysCPU.getCPUString() );
	support.append("\n");

	U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
	// Moved hack adjustment to Windows memory size into llsys.cpp

	LLString mem_text = llformat("Memory: %u MB\n", memory );
	support.append(mem_text);

	support.append("OS Version: ");
	support.append( LLAppViewer::instance()->getOSInfo().getOSString().c_str() );
	support.append("\n");

	support.append("Graphics Card Vendor: ");
	support.append( (const char*) glGetString(GL_VENDOR) );
	support.append("\n");

	support.append("Graphics Card: ");
	support.append( (const char*) glGetString(GL_RENDERER) );
	support.append("\n");

//.........这里部分代码省略.........
开发者ID:Boy,项目名称:netbook,代码行数:101,代码来源:llfloaterabout.cpp

示例4: buildClothingList

void LLFloaterClothing::buildClothingList()
{
	//llinfos << "buildClothingList" << llendl;

	LLScrollListCtrl* list = gUICtrlFactory->getScrollListByName(this, "clothing_list");
	if (!list) return;

	list->operateOnAll(LLCtrlListInterface::OP_DELETE);

	LLInventoryModel::cat_array_t cats;
	LLInventoryModel::item_array_t items;

	LLIsClothing is_clothing;
	gInventory.collectDescendentsIf(gAgent.getInventoryRootID(),
									cats,
									items,
									LLInventoryModel::EXCLUDE_TRASH,
									is_clothing);

	S32 count = items.count();
	for(S32 i = 0; i < count; ++i)
	{
		LLInventoryItem* item = items.get(i);

		LLSD row;
		row["id"] = item->getUUID();

		BOOL item_is_multi = FALSE;
		if ( item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
		{
			item_is_multi = TRUE;
		}

		LLUUID image_id = get_item_icon_uuid(item->getType(),
											 item->getInventoryType(),
											 item->getFlags(), item_is_multi);		// flags = wearable type
		row["columns"][0]["column"] = "icon";
		row["columns"][0]["type"] = "icon";
		row["columns"][0]["value"] = image_id;

		LLString text = item->getName();
		LLString style = "NORMAL";
		if( gAgent.isWearingItem( item->getUUID() ) )
		{
			text.append(" (worn)");
			style = "BOLD";
		}
		row["columns"][1]["column"] = "name";
		row["columns"][1]["value"] = text;
		row["columns"][1]["font"] = "SANSSERIFSMALL";
		row["columns"][1]["font-style"] = style;

		// hidden column for sorting
		U32 flags = item->getFlags();	// flags = wearable type
		enum EWearableType wearable_type = (enum EWearableType)flags;
		const char* wearable_label = LLWearable::typeToTypeLabel(wearable_type);
		//line->addColumn(wearable_label, FONT, -1);	// invisible
		row["columns"][2]["column"] = "sort";
		row["columns"][2]["value"] = wearable_label;

		list->addElement(row);
	}

	if (count > 0)
	{
		mAllowSelection = TRUE;
	}
	else if (LLInventoryModel::backgroundFetchActive())
	{
		// We're loading
		list->addCommentText(LOADING_STRING);
		mAllowSelection = FALSE;
	}
	else
	{
		// Weird case, we're done loading but have no clothing
		list->addCommentText("No clothing found.");
		mAllowSelection = FALSE;
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:80,代码来源:llfloaterclothing.cpp

示例5: sizeof


//.........这里部分代码省略.........
				throw 0;
			}
			
			if(result != CURLE_OK)
			{
				llinfos << "Error " << result << " while downloading disk image."<< llendl;
				throw 0;
			}
			
			fclose(downloadFile);
			downloadFile = NULL;
		}
		
		sendProgress(0, 0, CFSTR("Mounting image..."));
		LLFile::mkdir("mnt", 0700);
		
		// NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder,
		//		but if our cleanup fails, this makes it much harder for the user to unmount the image.
		LLString mountOutput;
		FILE* mounter = popen("hdiutil attach SecondLife.dmg -mountpoint mnt", "r");		/* Flawfinder: ignore */
		
		if(mounter == NULL)
		{
			llinfos << "Failed to mount disk image, exiting."<< llendl;
			throw 0;
		}
		
		// We need to scan the output from hdiutil to find the device node it uses to attach the disk image.
		// If we don't have this information, we can't detach it later.
		while(mounter != NULL)
		{
			size_t len = fread(temp, 1, sizeof(temp)-1, mounter);
			temp[len] = 0;
			mountOutput.append(temp);
			if(len < sizeof(temp)-1)
			{
				// End of file or error.
				if(pclose(mounter) != 0)
				{
					llinfos << "Failed to mount disk image, exiting."<< llendl;
					throw 0;
				}
				mounter = NULL;
			}
		}
		
		if(!mountOutput.empty())
		{
			const char *s = mountOutput.c_str();
			char *prefix = "/dev/";
			char *sub = strstr(s, prefix);
			
			if(sub != NULL)
			{
				sub += strlen(prefix);	/* Flawfinder: ignore */
				sscanf(sub, "%1023s", deviceNode);	/* Flawfinder: ignore */
			}
		}
		
		if(deviceNode[0] != 0)
		{
			llinfos << "Disk image attached on /dev/" << deviceNode << llendl;
		}
		else
		{
			llinfos << "Disk image device node not found!" << llendl;
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:67,代码来源:mac_updater.cpp


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