MCPcopy Create free account
hub / github.com/WinMerge/winmerge / writeMethodElement

Function writeMethodElement

Src/InternalPlugins.cpp:931–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931static void writeMethodElement(XMLWriter& writer, const std::string& tagname, const Method& method)
932{
933 writer.startElement("", "", tagname);
934 if (!method.m_command.empty())
935 {
936 writer.startElement("", "", CommandElement);
937 writer.characters(ucr::toUTF8(method.m_command));
938 writer.endElement("", "", CommandElement);
939 }
940 if (method.m_script)
941 {
942 AttributesImpl attrs;
943 if (!method.m_script->m_fileExtension.empty())
944 attrs.addAttribute("", "", FileExtensionAttribute, "", ucr::toUTF8(method.m_script->m_fileExtension));
945 writer.startElement("", "", ScriptElement, attrs);
946 writer.characters(ucr::toUTF8(method.m_script->m_body));
947 writer.endElement("", "", ScriptElement);
948 }
949 writer.endElement("", "", tagname);
950}
951
952bool SaveToXML(LocationType locationType, const std::list<Info>& internalPlugins, String& errmsg)
953{

Callers 1

SaveToXMLFunction · 0.85

Calls 6

addAttributeMethod · 0.80
toUTF8Function · 0.50
startElementMethod · 0.45
emptyMethod · 0.45
charactersMethod · 0.45
endElementMethod · 0.45

Tested by

no test coverage detected