blob: 60b9b13f7566b592f2288ed015ed8d3bed5a81c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#ifndef shell_manager_hh_INCLUDED
#define shell_manager_hh_INCLUDED
#include "array_view.hh"
#include "regex.hh"
#include "utils.hh"
#include "env_vars.hh"
namespace Kakoune
{
class Context;
class String;
class StringView;
using EnvVarRetriever = std::function<String (StringView name, const Context&)>;
class ShellManager : public Singleton<ShellManager>
{
public:
ShellManager();
String eval(StringView cmdline, const Context& context,
ConstArrayView<String> params,
const EnvVarMap& env_vars,
int* exit_status = nullptr);
String pipe(StringView input,
StringView cmdline, const Context& context,
ConstArrayView<String> params,
const EnvVarMap& env_vars,
int* exit_status = nullptr);
void register_env_var(StringView regex, EnvVarRetriever retriever);
String get_val(StringView name, const Context& context) const;
private:
Vector<std::pair<Regex, EnvVarRetriever>> m_env_vars;
};
}
#endif // shell_manager_hh_INCLUDED
|