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


C++ LLXMLNodePtr::setStringValue方法代码示例

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


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

示例1: writeSDValue

bool LLXUIParser::writeSDValue(const void* val_ptr, const name_stack_t& stack)
{
	LLXMLNodePtr node = getNode(stack);
	if (node.notNull())
	{
		std::string string_val = ((LLSD*)val_ptr)->asString();
		if (string_val.find('\n') != std::string::npos || string_val.size() > MAX_STRING_ATTRIBUTE_SIZE)
		{
			// don't write strings with newlines into attributes
			std::string attribute_name = node->getName()->mString;
			LLXMLNodePtr parent_node = node->mParent;
			parent_node->deleteChild(node);
			// write results in text contents of node
			if (attribute_name == "value")
			{
				// "value" is implicit, just write to parent
				node = parent_node;
			}
			else
			{
				node = parent_node->createChild(attribute_name.c_str(), false);
			}
		}

		node->setStringValue(string_val);
		return true;
	}
	return false;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:29,代码来源:llxuiparser.cpp

示例2: writeStringValue

bool LLXUIParser::writeStringValue(const void* val_ptr, const name_stack_t& stack)
{
	LLXMLNodePtr node = getNode(stack);
	if (node.notNull())
	{
		const std::string* string_val = reinterpret_cast<const std::string*>(val_ptr);
		if (string_val->find('\n') != std::string::npos 
			|| string_val->size() > MAX_STRING_ATTRIBUTE_SIZE)
		{
			// don't write strings with newlines into attributes
			std::string attribute_name = node->getName()->mString;
			LLXMLNodePtr parent_node = node->mParent;
			parent_node->deleteChild(node);
			// write results in text contents of node
			if (attribute_name == "value")
			{
				// "value" is implicit, just write to parent
				node = parent_node;
			}
			else
			{
				// create a child that is not an attribute, but with same name
				node = parent_node->createChild(attribute_name.c_str(), false);
			}
		}
		node->setStringValue(*string_val);
		return true;
	}
	return false;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:30,代码来源:llxuiparser.cpp

示例3: getXML

// virtual
LLXMLNodePtr LLRadioCtrl::getXML(bool save_children) const
{
	LLXMLNodePtr node = LLCheckBoxCtrl::getXML();

	node->setName(LL_RADIO_ITEM_TAG);

	node->setStringValue(getLabel());

	return node;
}
开发者ID:djhonga2001,项目名称:SingularityViewer,代码行数:11,代码来源:llradiogroup.cpp

示例4: writeUUIDValue

bool LLXUIParser::writeUUIDValue(const void* val_ptr, const name_stack_t& stack)
{
	LLXMLNodePtr node = getNode(stack);
	if (node.notNull())
	{
		node->setStringValue(((LLUUID*)val_ptr)->asString());
		return true;
	}
	return false;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:10,代码来源:llxuiparser.cpp

示例5: getXML

// virtual
LLXMLNodePtr LLTextBox::getXML(bool save_children) const
{
	LLXMLNodePtr node = LLUICtrl::getXML();

	// Attributes
	node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mFontGL));
	node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign));
	addColorXML(node, mTextColor, "text_color", "LabelTextColor");
	addColorXML(node, mDisabledColor, "disabled_color", "LabelDisabledColor");
	addColorXML(node, mBackgroundColor, "bg_color", "DefaultBackgroundColor");
	addColorXML(node, mBorderColor, "border_color", "DefaultHighlightLight");
	node->createChild("bg_visible", TRUE)->setBoolValue(mBackgroundVisible);
	node->createChild("border_visible", TRUE)->setBoolValue(mBorderVisible);
	node->createChild("border_drop_shadow_visible", TRUE)->setBoolValue(mBorderDropShadowVisible);
	node->createChild("h_pad", TRUE)->setIntValue(mHPad);
	node->createChild("v_pad", TRUE)->setIntValue(mVPad);

	// Contents
	node->setStringValue(mText);

	return node;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:23,代码来源:lltextbox.cpp


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