comparison base/HelperExecPath.h @ 1243:c7a710f806a1 piper

Add omitted files, again!
author Chris Cannam
date Tue, 01 Nov 2016 14:43:51 +0000
parents
children 75aefcc9f07d
comparison
equal deleted inserted replaced
1242:c401e738793f 1243:c7a710f806a1
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006-2016 Chris Cannam and QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef SV_HELPER_EXEC_PATH_H
17 #define SV_HELPER_EXEC_PATH_H
18
19 #include <QStringList>
20
21 /**
22 * Class to find helper executables that have been installed alongside
23 * the application. There may be more than one executable available
24 * with a given base name, because it's possible to have more than one
25 * implementation of a given service. For example, a plugin helper or
26 * scanner may exist in both 32-bit and 64-bit variants.
27 *
28 * This class encodes both the expected locations of helper
29 * executables, and the expected priority between different
30 * implementations (e.g. preferring the architecture that matches that
31 * of the host).
32 */
33 class HelperExecPath
34 {
35 public:
36 /**
37 * Find a helper executable with the given base name in the bundle
38 * directory or installation location, if one exists, and return
39 * its full path. Equivalent to calling getHelperExecutables() and
40 * taking the first result from the returned list (or "" if empty).
41 */
42 static QString getHelperExecutable(QString basename);
43
44 /**
45 * Find all helper executables with the given base name in the
46 * bundle directory or installation location, and return their
47 * full paths in order of priority.
48 */
49 static QStringList getHelperExecutables(QString basename);
50
51 /**
52 * Return the list of directories searched for helper
53 * executables.
54 */
55 static QStringList getHelperDirPaths();
56
57 /**
58 * Return the list of executable paths examined in the search for
59 * the helper executable with the given basename.
60 */
61 static QStringList getHelperCandidatePaths(QString basename);
62
63 private:
64 static QStringList search(QString, QStringList &);
65 };
66
67 #endif