OpenMS
Loading...
Searching...
No Matches
TOPPExternalToolBase.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm, Clemens Groepl, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/APPLICATIONS/OpenMS_CLIConfig.h>
12
14
15#include <map>
16#include <string>
17#include <vector>
18
19namespace OpenMS
20{
34 class OPENMS_CLI_DLLAPI TOPPExternalToolBase : public TOPPBase
35 {
36 public:
39
42
44 using TOPPBase::TOPPBase;
45
48
63
69 static StringList getThirdPartyToolLocations(const std::string& data_path);
70
81 static bool findThirdPartyExecutable(std::string& exe_filename);
82
89 static bool findThirdPartyExecutable(std::string& exe_filename, const StringList& locations);
90
91 protected:
97 bool findExecutable_(std::string& executable) const override;
98
100 ExitCodes runExternalProcess_(const std::string& executable, const std::vector<std::string>& arguments, const std::string& workdir = "", const std::map<std::string, std::string>& env = {}) const;
101
104 ExitCodes runExternalProcess_(const std::string& executable, const std::vector<std::string>& arguments, std::string& proc_stdout, std::string& proc_stderr, const std::string& workdir = "", const std::map<std::string, std::string>& env = {}) const;
105 };
106
107} // namespace OpenMS
Base class for TOPP applications.
Definition TOPPBase.h:57
ExitCodes
Exit codes.
Definition TOPPBase.h:69
Base class for TOPP tools that invoke an external executable.
Definition TOPPExternalToolBase.h:35
static bool findThirdPartyExecutable(std::string &exe_filename)
Looks for an executable among the third-party tools that ship with OpenMS.
TOPPExternalToolBase(const TOPPExternalToolBase &)=delete
No default copy constructor.
ExitCodes runExternalProcess_(const std::string &executable, const std::vector< std::string > &arguments, std::string &proc_stdout, std::string &proc_stderr, const std::string &workdir="", const std::map< std::string, std::string > &env={}) const
static bool findThirdPartyExecutable(std::string &exe_filename, const StringList &locations)
Looks for an executable in the given folders of third-party tools.
ExitCodes runExternalProcess_(const std::string &executable, const std::vector< std::string > &arguments, const std::string &workdir="", const std::map< std::string, std::string > &env={}) const
Runs an external process via ExternalProcess and prints its stderr output on failure or if debug_leve...
TOPPExternalToolBase()=delete
No default constructor.
static StringList getThirdPartyToolLocations(const std::string &data_path)
The folders of the third-party tools in THIRDPARTY of the shared-data directory data_path.
~TOPPExternalToolBase() override
Destructor.
static StringList getThirdPartyToolLocations()
The folders of the third-party tools that ship with OpenMS.
bool findExecutable_(std::string &executable) const override
Searches the PATH (File::findExecutable()), then the third-party tools that ship with OpenMS (findThi...
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19