kakoune/src/shell_manager.hh
Maxime Coste 0c596a9d64 Add a ShellManager which handles executing shell commands
ShellManager provides shell commands with environement variable
to retrieve some internal values in the shell parameters.
2012-05-03 07:25:13 +00:00

33 lines
630 B
C++

#ifndef shell_manager_hh_INCLUDED
#define shell_manager_hh_INCLUDED
#include "utils.hh"
#include "regex.hh"
#include <unordered_map>
namespace Kakoune
{
class Context;
typedef std::function<String (const Context&)> EnvVarRetriever;
class ShellManager : public Singleton<ShellManager>
{
public:
ShellManager();
String eval(const String& cmdline, const Context& context);
void register_env_var(const String& name, EnvVarRetriever retriever);
private:
Regex m_regex;
std::unordered_map<String, EnvVarRetriever> m_env_vars;
};
}
#endif // shell_manager_hh_INCLUDED