本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}