~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/utf8/utf8.h

  • Committer: Monty Taylor
  • Date: 2010-07-19 05:06:59 UTC
  • mto: (1662.1.2 rollup)
  • mto: This revision was merged to the branch mainline in revision 1663.
  • Revision ID: mordred@inaugust.com-20100719050659-if3thz0k66m1jkaf
Backed out two bits that snuck in to the merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
  along with this program; if not, write to the Free Software
17
17
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 
19
 
  Copyright (C) 1995-2006 International Business Machines Corporation and others
 
19
  Copyright (c) 1995-2006 International Business Machines Corporation and others
20
20
 
21
21
  All rights reserved.
22
22
 
49
49
 
50
50
#include <string>
51
51
 
52
 
#include <drizzled/utf8/checked.h>
53
 
#include <drizzled/utf8/unchecked.h>
54
 
 
55
52
namespace drizzled
56
53
{
57
54
namespace utf8
113
110
static inline uint32_t char_length(const std::string &in_string)
114
111
{
115
112
  uint32_t length= 0;
116
 
  int seq_length= 0;
117
113
  std::string::const_iterator iter= in_string.begin();
118
114
  while (iter < in_string.end())
119
115
  {
120
116
    length++;
121
 
    seq_length= sequence_length(*iter);
122
 
    iter += (seq_length > 0) ? seq_length : 1;
 
117
    iter += sequence_length(*iter);
123
118
  }
124
119
  return length;
125
120
}