本文整理汇总了C++中pugi::xml_node::append_child方法的典型用法代码示例。如果您正苦于以下问题:C++ xml_node::append_child方法的具体用法?C++ xml_node::append_child怎么用?C++ xml_node::append_child使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pugi::xml_node
的用法示例。
在下文中一共展示了xml_node::append_child方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTextElement
void AddTextElement(pugi::xml_node node, const char* name, int64_t value, bool overwrite)
{
if (overwrite) {
node.remove_child(name);
}
auto child = node.append_child(name);
child.text().set(static_cast<long long>(value));
}
示例2: SaveItem
void CServerItem::SaveItem(pugi::xml_node& element) const
{
auto server = element.append_child("Server");
SetServer(server, m_server);
for (auto iter = m_children.cbegin() + m_removed_at_front; iter != m_children.cend(); ++iter)
(*iter)->SaveItem(server);
}
示例3:
pugi::xml_node
NameValues::Write(pugi::xml_node out) const
{
pugi::xml_node root = out.append_child("NameValues");
for (const_iterator i=begin(), endi=end(); i != endi; ++i)
append_data(root, *i);
return root;
}
示例4:
pugi::xml_node
Bytecode::Fixup::Write(pugi::xml_node out) const
{
pugi::xml_node root = out.append_child("Fixup");
root.append_attribute("offset") = m_off;
Value::Write(root);
return root;
}
示例5: WriteSerializedData
void obj_DamageArea::WriteSerializedData(pugi::xml_node& node)
{
GameObject::WriteSerializedData(node);
pugi::xml_node damageAreaNode = node.append_child();
damageAreaNode.set_name("damageArea");
damageAreaNode.append_attribute("radius") = m_Radius;
damageAreaNode.append_attribute("damage") = m_Damage;
}
示例6: serialize
void CArenaMapNode::serialize(pugi::xml_node &parent)
{
pugi::xml_node node = parent.append_child("arena");
CNode::serialize(node);
// node.append_attribute("id").set_value(getId());
node.append_attribute("path").set_value(m_filePath.c_str());
}
示例7: GetAsynchronousRecord
void DR::EMHandler::getDynamicRecording(pugi::xml_node &frame)
{
int errorCode;
if (!m_connected)
return;
pugi::xml_node trackSTAR = frame.append_child("TrackSTAR");
trackSTAR.append_attribute("Unit").set_value("millimeter");
m_lock.lock();
// Collect data from all birds
// Loop through all sensors and get a data record if the sensor is attached.
// Print result to screen
// Note: The default data format is DOUBLE_POSITION_ANGLES. We can use this
// format without first setting it.
//
//
DOUBLE_POSITION_QUATERNION_RECORD record, *pRecord = &record;
// scan the sensors and request a record
for (int sensorID = 0; sensorID < ATC3DG.m_config.numberSensors; sensorID++)
{
// sensor attached so get record
errorCode = GetAsynchronousRecord(sensorID, pRecord, sizeof(record));
if (errorCode != BIRD_ERROR_SUCCESS) {
errorHandler(errorCode);
return;
}
// get the status of the last data record
// only report the data if everything is okay
unsigned int status = GetSensorStatus(sensorID);
if (status == VALID_STATUS)
{
pugi::xml_node bird_node = trackSTAR.append_child("BIRD");
pugi::xml_attribute id = bird_node.append_attribute("id");
id.set_value(sensorID);
pugi::xml_node position_node = bird_node.append_child();
position_node.set_name("Position");
position_node.append_attribute("X").set_value(record.x*1000.0f);
position_node.append_attribute("Y").set_value(record.y*1000.0f);
position_node.append_attribute("Z").set_value(record.z*1000.0f);
pugi::xml_node rotation_node = bird_node.append_child();
rotation_node.set_name("Rotation");
rotation_node.append_attribute("W").set_value(record.q[0]);
rotation_node.append_attribute("X").set_value(record.q[1]);
rotation_node.append_attribute("Y").set_value(record.q[2]);
rotation_node.append_attribute("Z").set_value(record.q[3]);
}
}
m_lock.unlock();
}
示例8:
// Save Game State
bool j1Render::Save(pugi::xml_node& data) const
{
pugi::xml_node cam = data.append_child("camera");
cam.append_attribute("x") = camera.x;
cam.append_attribute("y") = camera.y;
return true;
}
示例9: writeFrame
void ImageExportSerializer::writeFrame(pugi::xml_node _parent, DataPtr _data)
{
pugi::xml_node node = _parent.append_child("Frame");
node.append_attribute("point").set_value(_data->getPropertyValue("Point").c_str());
size_t count = MyGUI::utility::parseValue<size_t>(_data->getPropertyValue("Count"));
if (count > 1)
node.append_attribute("count").set_value(MyGUI::utility::toString(count).c_str());
}
示例10: switch
pugi::xml_node
ElfSymbol::Write(pugi::xml_node out) const
{
pugi::xml_node root = out.append_child("ElfSymbol");
root.append_attribute("key") = key;
if (m_sect)
root.append_attribute("sect") = m_sect->getName().str().c_str();
append_child(root, "Value", m_value);
if (!m_size.isEmpty())
append_child(root, "Size", m_size).append_attribute("source") =
m_size_source.getRawEncoding();
switch (m_index)
{
case SHN_UNDEF: append_child(root, "Index", "UNDEF"); break;
case SHN_ABS: append_child(root, "Index", "ABS"); break;
case SHN_COMMON: append_child(root, "Index", "COMMON"); break;
default: append_child(root, "Index", m_index); break;
}
switch (m_bind)
{
case STB_LOCAL: append_child(root, "Bind", "local"); break;
case STB_GLOBAL: append_child(root, "Bind", "global"); break;
case STB_WEAK: append_child(root, "Bind", "weak"); break;
default:
append_child(root, "Bind", static_cast<int>(m_bind));
break;
}
switch (m_type)
{
case STT_NOTYPE: append_child(root, "SymType", "notype"); break;
case STT_OBJECT: append_child(root, "SymType", "object"); break;
case STT_FUNC: append_child(root, "SymType", "func"); break;
case STT_SECTION: append_child(root, "SymType", "section"); break;
case STT_FILE: append_child(root, "SymType", "file"); break;
case STT_COMMON: append_child(root, "SymType", "common"); break;
case STT_TLS: append_child(root, "SymType", "tls"); break;
default:
append_child(root, "SymType", static_cast<int>(m_type));
break;
}
switch (m_vis)
{
case STV_DEFAULT: append_child(root, "Vis", "default"); break;
case STV_INTERNAL: append_child(root, "Vis", "internal"); break;
case STV_HIDDEN: append_child(root, "Vis", "hidden"); break;
case STV_PROTECTED: append_child(root, "Vis", "protected"); break;
default:
append_child(root, "Vis", static_cast<int>(m_vis));
break;
}
append_child(root, "SymIndex", m_symindex);
return root;
}
示例11: saveRoute
void PathEditor::saveRoute(const std::vector<Point> & array, pugi::xml_node & node)
{
for ( auto i : array )
{
auto child = node.append_child("point");
child.append_attribute("x").set_value( intToStr(i.x).c_str() );
child.append_attribute("y").set_value( intToStr(i.y).c_str() );
}
}
示例12: save
bool Render::save(pugi::xml_node &node) const
{
pugi::xml_node cam = node.append_child("camera");
cam.append_attribute("x") = camera.x;
cam.append_attribute("y") = camera.y;
return true;
}
示例13: WriteSerializedData
void obj_ReverbZone::WriteSerializedData(pugi::xml_node& node)
{
GameObject::WriteSerializedData(node);
pugi::xml_node reverbNode = node.append_child();
reverbNode.set_name("reverbZone");
reverbNode.append_attribute("preset") = ReverbName;
reverbNode.append_attribute("min") = m_minDist;
reverbNode.append_attribute("max") = m_maxDist;
}
示例14: add_node
static void add_node(pugi::xml_node& graph, int id, std::string label)
{
auto node = graph.append_child("node");
node.append_attribute("id") = std::to_string(id).c_str();
auto data = node.append_child("data");
data.append_attribute("key") = "label";
data.text() = label.c_str();
}
示例15: writeImage
void ImageExportSerializer::writeImage(pugi::xml_node _parent, DataPtr _data)
{
pugi::xml_node node = _parent.append_child("Resource");
node.append_attribute("type").set_value("ResourceImageSet");
node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str());
for (Data::VectorData::const_iterator child = _data->getChilds().begin(); child != _data->getChilds().end(); child ++)
writeGroup(node, (*child));
}