void VCProjectConfiguration::writeSummary(pugi::xml_node& parent) const { for (auto platform : m_platforms) { std::string configPlatform = getVSConfigurationPlatform(m_name, platform.first); pugi::xml_node configDesc = parent.append_child("ProjectConfiguration"); configDesc.append_attribute("Include") = configPlatform.c_str(); appendNodeWithText(configDesc, "Configuration", m_name); appendNodeWithText(configDesc, "Platform", platform.first); } }
void writePropertiesMap(const StringMap& props, pugi::xml_node& parent) { for (auto propKV : props) { if (!propKV.first.empty()) { appendNodeWithText(parent, propKV.first, propKV.second); } } }
void writePropertiesMap(const ConditionalValueListMap& props, pugi::xml_node& parent) { for (auto propKV : props) { if (propKV.first.empty()) continue; for (auto cvalue : propKV.second) { appendNodeWithText(parent, propKV.first, cvalue.value, cvalue.condition); } } }
void VCProject::writeProjectReferences(pugi::xml_node& node) const { std::string projectPath = getPath(); std::string projectDir = sb_dirname(projectPath); for (auto dep : m_projectRefs) { std::string depGUID = formatVSGUID(dep->getId()); std::string depRelativePath = getRelativePath(projectDir, dep->getPath()); pugi::xml_node projRef = node.append_child("ProjectReference"); projRef.append_attribute("Include") = depRelativePath.c_str(); appendNodeWithText(projRef, "Project", depGUID); } }
void VCProject::writeFilterItemDescriptions(pugi::xml_node& node) const { pugi::xml_node tempNode = node.parent().append_child("Temp"); for (auto item : m_items) { std::string itemName = item->getItemName(); std::string includePath = item->getIncludePath(); std::string filterPath = item->getFilterPath(); pugi::xml_node fItem = tempNode.append_child(itemName.c_str()); fItem.append_attribute("Include") = includePath.c_str(); if (!filterPath.empty() && filterPath != ".") { appendNodeWithText(fItem, "Filter", winPath(filterPath)); } } mergeNodes(node, tempNode); }
void VCProject::writeFilterDescriptions(pugi::xml_node& node) const { StringSet filters; for (auto item : m_items) { recordFilterPath(item->getFilterPath(), filters); } pugi::xml_node tempNode = node.parent().append_child("Temp"); for (auto filter : filters) { // Generate a unique id std::string id = sole::uuid4().str(); // Fix up the filter path to be Windows-style std::string winFilterPath = winPath(filter); // Create a filter description node pugi::xml_node filterDesc = tempNode.append_child("Filter"); filterDesc.append_attribute("Include") = winFilterPath.c_str(); appendNodeWithText(filterDesc, "UniqueIdentifier", formatVSGUID(id)); } mergeNodes(node, tempNode); }