1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-19 09:21:30 +03:00
kakoune/src/shell_manager.hh

44 lines
1.1 KiB
C++
Raw Normal View History

#ifndef shell_manager_hh_INCLUDED
#define shell_manager_hh_INCLUDED
#include "regex.hh"
2013-04-09 22:05:40 +04:00
#include "utils.hh"
#include "env_vars.hh"
namespace Kakoune
{
2014-01-28 00:28:38 +04:00
class Context;
2015-01-06 16:40:56 +03:00
template<typename T> class ArrayView;
2014-11-13 00:27:07 +03:00
class String;
class StringView;
2014-04-20 15:15:31 +04:00
using EnvVarRetriever = std::function<String (StringView name, const Context&)>;
class ShellManager : public Singleton<ShellManager>
{
public:
ShellManager();
2014-04-20 15:15:31 +04:00
String eval(StringView cmdline, const Context& context,
2015-01-06 16:40:56 +03:00
ArrayView<String> params,
const EnvVarMap& env_vars,
int* exit_status = nullptr);
2014-04-20 15:15:31 +04:00
String pipe(StringView input,
StringView cmdline, const Context& context,
2015-01-06 16:40:56 +03:00
ArrayView<String> params,
const EnvVarMap& env_vars,
int* exit_status = nullptr);
2014-04-20 15:15:31 +04:00
void register_env_var(StringView regex, EnvVarRetriever retriever);
String get_val(StringView name, const Context& context) const;
private:
std::vector<std::pair<Regex, EnvVarRetriever>> m_env_vars;
};
}
#endif // shell_manager_hh_INCLUDED