~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/user.h

  • Committer: Lee Bieber
  • Date: 2011-03-22 17:41:09 UTC
  • mfrom: (2241.2.18 refactor2)
  • Revision ID: kalebral@gmail.com-20110322174109-1bsfvv4q1dnfd089
Merge Olaf - more code refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <string>
24
24
#include <boost/shared_ptr.hpp>
25
 
 
 
25
#include <drizzled/identifier.h>
26
26
#include <drizzled/visibility.h>
27
27
 
28
 
namespace drizzled
29
 
{
30
 
namespace identifier
31
 
{
 
28
namespace drizzled {
 
29
namespace identifier {
32
30
 
33
31
/**
34
32
  @class User
51
49
  };
52
50
 
53
51
  User():
54
 
    password_type(NONE),
55
 
    _user(""),
56
 
    _address("")
 
52
    password_type(NONE)
57
53
  { }
58
54
 
59
55
  virtual void getSQLPath(std::string &arg) const;
60
56
 
61
57
  bool hasPassword() const
62
58
  {
63
 
    switch (password_type)
64
 
    {
65
 
    case NONE:
66
 
      return false;
67
 
    case PLAIN_TEXT:
68
 
    case MYSQL_HASH:
69
 
      break;
70
 
    }
71
 
 
72
 
    return true;
 
59
    return password_type != NONE;
73
60
  }
74
61
 
75
62
  const std::string& address() const
79
66
 
80
67
  void setAddress(const char *newip)
81
68
  {
82
 
    _address.assign(newip);
 
69
    _address = newip;
83
70
  }
84
71
 
85
72
  const std::string& username() const
89
76
 
90
77
  void setUser(const std::string &newuser)
91
78
  {
92
 
    _user.assign(newuser);
 
79
    _user = newuser;
93
80
  }
94
81
 
95
 
  PasswordType getPasswordType(void) const
 
82
  PasswordType getPasswordType() const
96
83
  {
97
84
    return password_type;
98
85
  }