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

40 lines
926 B
C++
Raw Normal View History

#ifndef shell_manager_hh_INCLUDED
#define shell_manager_hh_INCLUDED
#include "string.hh"
2013-04-09 22:05:40 +04:00
#include "utils.hh"
#include <unordered_map>
namespace Kakoune
{
2014-01-28 00:28:38 +04:00
class Context;
using EnvVarRetriever = std::function<String (const String& name, const Context&)>;
using EnvVarMap = std::unordered_map<String, String>;
class ShellManager : public Singleton<ShellManager>
{
public:
ShellManager();
String eval(const String& cmdline, const Context& context,
2013-07-26 03:17:12 +04:00
memoryview<String> params,
const EnvVarMap& env_vars);
String pipe(const String& input,
const String& cmdline, const Context& context,
2013-07-26 03:17:12 +04: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