~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/instance/base.h

  • Committer: Olaf van der Spek
  • Date: 2011-07-05 18:15:41 UTC
  • mto: This revision was merged to the branch mainline in revision 2384.
  • Revision ID: olafvdspek@gmail.com-20110705181541-t5gdqo5ilg64jac6
Use boost::to_upper

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
 
188
188
  std::vector<std::string> _keynames;
189
189
 
190
 
  void addKeyName(std::string arg)
 
190
  void addKeyName(const std::string& arg)
191
191
  {
192
 
    std::transform(arg.begin(), arg.end(),
193
 
                   arg.begin(), ::toupper);
194
 
    _keynames.push_back(arg);
 
192
    _keynames.push_back(boost::to_upper_copy(arg));
195
193
  }
196
194
 
197
195
public:
200
198
    return doesKeyNameExist(std::string(name_arg, name_length), position);
201
199
  }
202
200
 
203
 
  bool doesKeyNameExist(std::string arg, uint32_t &position) const
 
201
  bool doesKeyNameExist(const std::string& arg, uint32_t &position) const
204
202
  {
205
 
    std::transform(arg.begin(), arg.end(),
206
 
                   arg.begin(), ::toupper);
207
 
 
208
 
    std::vector<std::string>::const_iterator iter= std::find(_keynames.begin(), _keynames.end(), arg);
 
203
    std::vector<std::string>::const_iterator iter= std::find(_keynames.begin(), _keynames.end(), boost::to_upper_copy(arg));
209
204
 
210
205
    if (iter == _keynames.end())
211
206
    {
214
209
    }
215
210
 
216
211
    position= iter -  _keynames.begin();
217
 
 
218
212
    return true;
219
213
  }
220
214