~linuxjedi/drizzle/trunk-bug-689448

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.h

  • Committer: Brian Aker
  • Date: 2010-12-16 18:52:06 UTC
  • mfrom: (1999.2.2 compare)
  • Revision ID: brian@tangent.org-20101216185206-nqx8ys9jj863xqie
Merge in identifier work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
  std::string db_path;
58
58
  std::string catalog;
59
59
 
60
 
 
61
 
  // @note this should be changed to protected once Session contains an
62
 
  // identifier for current db.
63
 
public:
64
 
 
65
60
public:
66
61
  typedef std::vector <SchemaIdentifier> vector;
 
62
  typedef const SchemaIdentifier& const_reference;
67
63
 
68
64
  SchemaIdentifier(const std::string &db_arg);
69
65
 
83
79
    return catalog;
84
80
  }
85
81
 
86
 
  bool isValid() const;
 
82
  virtual bool isValid() const;
 
83
 
87
84
  bool compare(const std::string &arg) const;
 
85
  bool compare(SchemaIdentifier::const_reference) const;
88
86
 
89
 
  friend bool operator<(const SchemaIdentifier &left, const SchemaIdentifier &right)
 
87
  friend bool operator<(SchemaIdentifier::const_reference left, SchemaIdentifier::const_reference right)
90
88
  {
91
89
    return  boost::algorithm::to_upper_copy(left.getSchemaName()) < boost::algorithm::to_upper_copy(right.getSchemaName());
92
90
  }
93
91
 
94
92
  friend std::ostream& operator<<(std::ostream& output,
95
 
                                  SchemaIdentifier &identifier)
 
93
                                  SchemaIdentifier::const_reference identifier)
96
94
  {
97
95
    output << "SchemaIdentifier:(";
98
96
    output <<  identifier.catalog;
105
103
    return output;  // for multiple << operators.
106
104
  }
107
105
 
108
 
  friend bool operator==(const SchemaIdentifier &left,
109
 
                         const SchemaIdentifier &right)
 
106
  friend bool operator==(SchemaIdentifier::const_reference left,
 
107
                         SchemaIdentifier::const_reference right)
110
108
  {
111
109
    return boost::iequals(left.getSchemaName(), right.getSchemaName());
112
110
  }
113
 
 
114
111
};
115
112
 
116
113