| 757 | } |
| 758 | |
| 759 | bool 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 | |
| 788 | Info* GetInternalPluginInfo(const PluginInfo* plugin) |
| 789 | { |
no test coverage detected