~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/option_map.h

  • Committer: Zimin
  • Date: 2010-06-30 06:36:56 UTC
  • mto: (1643.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 1644.
  • Revision ID: ziminq@gmail.com-20100630063656-5oa531u1mfyn6ybl
move the comment of 'create' in TableList as well

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#define DRIZZLED_MODULE_OPTION_MAP_H
27
27
 
28
28
#include "drizzled/visibility.h"
29
 
#include "drizzled/module/option_context.h"
30
29
 
31
30
#include <boost/program_options.hpp>
32
31
 
44
43
class DRIZZLED_API option_map
45
44
{
46
45
  const std::string &module_name;
 
46
  const boost::program_options::variables_map &vm;
 
47
 
47
48
public:
48
 
  const boost::program_options::variables_map &vm;
49
 
 
50
49
 
51
50
  option_map(const std::string &module_name_in,
52
51
             const boost::program_options::variables_map &vm_in);
54
53
 
55
54
  const boost::program_options::variable_value& operator[](const std::string &name_in) const
56
55
  {
57
 
    return vm[option_context::prepend_name(module_name, name_in.c_str())];
 
56
    std::string new_name(module_name);
 
57
    new_name.push_back('.');
 
58
    new_name.append(name_in);
 
59
    return vm[new_name];
58
60
  }
59
61
 
60
62
  size_t count(const std::string &name_in) const
61
63
  {
62
 
    return vm.count(option_context::prepend_name(module_name, name_in.c_str()));
 
64
    std::string new_name(module_name);
 
65
    new_name.push_back('.');
 
66
    new_name.append(name_in);
 
67
    return vm.count(new_name);
63
68
  }
64
69
 
65
70
private: