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

Function LoadFromXML

Src/InternalPlugins.cpp:759–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759bool LoadFromXML(LocationType locationType, std::list<Info>& internalPlugins, String& errmsg)
760{
761 XMLHandler handler(&internalPlugins);
762 SAXParser parser;
763 parser.setFeature(SAXParser::FEATURE_EXTERNAL_GENERAL_ENTITIES, false);
764 parser.setFeature(SAXParser::FEATURE_EXTERNAL_PARAMETER_ENTITIES, false);
765 parser.setContentHandler(&handler);
766 try
767 {
768 size_t size = internalPlugins.size();
769 const String pluginsXMLPath = GetPluginXMLPath(locationType);
770 try { parser.parse(ucr::toUTF8(pluginsXMLPath)); }
771 catch (Poco::FileNotFoundException&) { }
772 size_t i = 0;
773 for (auto& info : internalPlugins)
774 {
775 if (i >= size)
776 info.m_locationType = locationType;
777 ++i;
778 }
779 }
780 catch (Poco::XML::SAXParseException& e)
781 {
782 errmsg = ucr::toTString(e.message());
783 return false;
784 }
785 return true;
786}
787
788Info* GetInternalPluginInfo(const PluginInfo* plugin)
789{

Callers 4

AddPluginFunction · 0.85
UpdatePluginFunction · 0.85
RemovePluginFunction · 0.85
LoadMethod · 0.85

Calls 8

GetPluginXMLPathFunction · 0.85
toTStringFunction · 0.85
toUTF8Function · 0.50
setFeatureMethod · 0.45
setContentHandlerMethod · 0.45
sizeMethod · 0.45
parseMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected