annotate checker/knownplugincandidates.h @ 64:e839338d3869 tip

Further Windows fix
author Chris Cannam
date Wed, 15 Apr 2020 16:30:40 +0100
parents 40c6936c2fc9
children
rev   line source
Chris@35 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@35 2 /*
Chris@35 3 Copyright (c) 2016-2018 Queen Mary, University of London
Chris@35 4
Chris@35 5 Permission is hereby granted, free of charge, to any person
Chris@35 6 obtaining a copy of this software and associated documentation
Chris@35 7 files (the "Software"), to deal in the Software without
Chris@35 8 restriction, including without limitation the rights to use, copy,
Chris@35 9 modify, merge, publish, distribute, sublicense, and/or sell copies
Chris@35 10 of the Software, and to permit persons to whom the Software is
Chris@35 11 furnished to do so, subject to the following conditions:
Chris@35 12
Chris@35 13 The above copyright notice and this permission notice shall be
Chris@35 14 included in all copies or substantial portions of the Software.
Chris@35 15
Chris@35 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@35 17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@35 18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Chris@35 19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
Chris@35 20 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@35 21 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@35 22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@35 23
Chris@35 24 Except as contained in this notice, the names of the Centre for
Chris@35 25 Digital Music and Queen Mary, University of London shall not be
Chris@35 26 used in advertising or otherwise to promote the sale, use or other
Chris@35 27 dealings in this Software without prior written authorization.
Chris@35 28 */
Chris@35 29
Chris@35 30 #ifndef KNOWN_PLUGIN_CANDIDATES_H
Chris@35 31 #define KNOWN_PLUGIN_CANDIDATES_H
Chris@35 32
Chris@35 33 #include "plugincandidates.h"
Chris@35 34 #include "knownplugins.h"
Chris@35 35
Chris@35 36 #include <string>
Chris@35 37 #include <map>
Chris@35 38 #include <vector>
Chris@35 39
Chris@35 40 /**
Chris@35 41 * Class to identify and list candidate shared-library files possibly
Chris@35 42 * containing plugins in a hardcoded set of known formats. Uses a
Chris@35 43 * separate process (the "helper", whose executable name must be
Chris@35 44 * provided at construction) to test-load each library in order to
Chris@35 45 * winnow out any that fail to load or crash on load.
Chris@35 46 *
Chris@35 47 * In v1 of the checker library this was the role of the KnownPlugins
Chris@35 48 * class, but that has been changed so that it only provides static
Chris@35 49 * known information about plugin formats and paths, and this class
Chris@35 50 * has been introduced instead (tying that static information together
Chris@35 51 * with a PluginCandidates object that handles the run-time query).
Chris@35 52 *
Chris@35 53 * Requires C++11 and the Qt5 QtCore library.
Chris@35 54 */
Chris@35 55 class KnownPluginCandidates
Chris@35 56 {
Chris@35 57 typedef std::vector<std::string> stringlist;
Chris@35 58
Chris@35 59 public:
Chris@35 60 KnownPluginCandidates(std::string helperExecutableName,
Chris@35 61 PluginCandidates::LogCallback *cb = 0);
Chris@35 62
Chris@35 63 std::vector<KnownPlugins::PluginType> getKnownPluginTypes() const {
Chris@35 64 return m_known.getKnownPluginTypes();
Chris@35 65 }
Chris@35 66
Chris@35 67 std::string getTagFor(KnownPlugins::PluginType type) const {
Chris@35 68 return m_known.getTagFor(type);
Chris@35 69 }
Chris@35 70
Chris@35 71 stringlist getCandidateLibrariesFor(KnownPlugins::PluginType type) const {
Chris@35 72 return m_candidates.getCandidateLibrariesFor(m_known.getTagFor(type));
Chris@35 73 }
Chris@35 74
Chris@35 75 std::string getHelperExecutableName() const {
Chris@35 76 return m_helperExecutableName;
Chris@35 77 }
Chris@35 78
Chris@40 79 std::vector<PluginCandidates::FailureRec> getFailures() const;
Chris@40 80
Chris@40 81 /** Return a non-localised HTML failure report */
Chris@35 82 std::string getFailureReport() const;
Chris@35 83
Chris@35 84 private:
Chris@35 85 KnownPlugins m_known;
Chris@35 86 PluginCandidates m_candidates;
Chris@35 87 std::string m_helperExecutableName;
Chris@35 88 };
Chris@35 89
Chris@35 90 #endif
Chris@35 91