comparison checker/plugincandidates.h @ 45:ad02dff8ebfb

Merge from branch errorcode
author Chris Cannam
date Fri, 31 Aug 2018 15:14:57 +0100
parents 40c6936c2fc9
children 81ce3ba92b16
comparison
equal deleted inserted replaced
39:a28b19b136e8 45:ad02dff8ebfb
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 /* 2 /*
3 Copyright (c) 2016 Queen Mary, University of London 3 Copyright (c) 2016-2018 Queen Mary, University of London
4 4
5 Permission is hereby granted, free of charge, to any person 5 Permission is hereby granted, free of charge, to any person
6 obtaining a copy of this software and associated documentation 6 obtaining a copy of this software and associated documentation
7 files (the "Software"), to deal in the Software without 7 files (the "Software"), to deal in the Software without
8 restriction, including without limitation the rights to use, copy, 8 restriction, including without limitation the rights to use, copy,
31 #define PLUGIN_CANDIDATES_H 31 #define PLUGIN_CANDIDATES_H
32 32
33 #include <string> 33 #include <string>
34 #include <vector> 34 #include <vector>
35 #include <map> 35 #include <map>
36
37 #include "checkcode.h"
36 38
37 /** 39 /**
38 * Class to identify and list candidate shared-library files possibly 40 * Class to identify and list candidate shared-library files possibly
39 * containing plugins. Uses a separate process (the "helper", whose 41 * containing plugins. Uses a separate process (the "helper", whose
40 * executable name must be provided at construction) to test-load each 42 * executable name must be provided at construction) to test-load each
79 81
80 /** Return list of plugin library paths that were checked 82 /** Return list of plugin library paths that were checked
81 * successfully during the scan for the given tag. 83 * successfully during the scan for the given tag.
82 */ 84 */
83 stringlist getCandidateLibrariesFor(std::string tag) const; 85 stringlist getCandidateLibrariesFor(std::string tag) const;
86
87 struct FailureRec {
84 88
85 struct FailureRec { 89 /// Path of failed library file
86 std::string library; 90 std::string library;
91
92 /// General class of failure
93 PluginCheckCode code;
94
95 /// Optional additional system-level message, already translated
87 std::string message; 96 std::string message;
88 }; 97 };
89 98
90 /** Return list of failure reports arising from the prior scan for 99 /** Return list of failure reports arising from the prior scan for
91 * the given tag. 100 * the given tag.
97 std::map<std::string, stringlist> m_candidates; 106 std::map<std::string, stringlist> m_candidates;
98 std::map<std::string, std::vector<FailureRec> > m_failures; 107 std::map<std::string, std::vector<FailureRec> > m_failures;
99 LogCallback *m_logCallback; 108 LogCallback *m_logCallback;
100 109
101 stringlist getLibrariesInPath(stringlist path); 110 stringlist getLibrariesInPath(stringlist path);
111 std::string getHelperCompatibilityVersion();
102 stringlist runHelper(stringlist libraries, std::string descriptor); 112 stringlist runHelper(stringlist libraries, std::string descriptor);
103 void recordResult(std::string tag, stringlist results); 113 void recordResult(std::string tag, stringlist results);
104 void log(std::string); 114 void log(std::string);
105 }; 115 };
106 116