21 #include <boost/algorithm/string.hpp>
22 #include <drizzled/module/context.h>
24 #include <drizzled/module/module.h>
25 #include <drizzled/drizzled.h>
26 #include <drizzled/sys_var.h>
31 module::option_map Context::getOptions()
33 return module::option_map(module->getName(), getVariablesMap());
36 void Context::registerVariable(sys_var *var)
38 var->setName(prepend_name(module->getName(), var->getName()));
39 module->addMySysVar(var);
40 add_sys_var_to_list(var);
43 std::string Context::prepend_name(std::string module_name,
44 const std::string &var_name)
46 module_name.push_back(
'_');
47 module_name.append(var_name);
48 std::replace(module_name.begin(), module_name.end(),
'-',
'_');
49 return boost::to_lower_copy(module_name);
TODO: Rename this file - func.h is stupid.
An Proxy Wrapper around boost::program_options::variables_map.