home/src/shell_manager.hh

38 lines
869 B
C++
Raw Normal View History

#ifndef shell_manager_hh_INCLUDED
#define shell_manager_hh_INCLUDED
#include "string.hh"
2013-04-09 20:05:40 +02:00
#include "utils.hh"
#include "env_vars.hh"
namespace Kakoune
{
2014-01-27 21:28:38 +01:00
class Context;
using EnvVarRetriever = std::function<String (const String& name, const Context&)>;
class ShellManager : public Singleton<ShellManager>
{
public:
ShellManager();
String eval(const String& cmdline, const Context& context,
2013-07-26 01:17:12 +02:00
memoryview<String> params,
const EnvVarMap& env_vars);
String pipe(const String& input,
const String& cmdline, const Context& context,
2013-07-26 01:17:12 +02:00
memoryview<String> params,
const EnvVarMap& env_vars);
void register_env_var(const String& regex, EnvVarRetriever retriever);
private:
std::vector<std::pair<Regex, EnvVarRetriever>> m_env_vars;
};
}
#endif // shell_manager_hh_INCLUDED