MySQL  8.0.17
Source Code Documentation
dd_utility.h
Go to the documentation of this file.
1 /* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef DD__UTILITY_INCLUDED
24 #define DD__UTILITY_INCLUDED
25 
26 #include "sql/dd/string_type.h" // dd::String_type
27 
28 struct CHARSET_INFO;
29 
30 namespace dd {
31 
32 ///////////////////////////////////////////////////////////////////////////
33 
34 /**
35  Normalize (or transform) the multibyte character set string.
36 
37  The normalized string contains the weight of the each character of the source
38  string. The normalized strings are suitable for the comparisons (strings
39  yields the correct collation order).
40 
41  @param cs Character set.
42  @param src Source string.
43  @param[out] normalized_str_buf Buffer to store the normalized string.
44  @param normalized_str_buf_length Size of the normalized_str_buf.
45 
46  @returns length of the normalized string. 0 is returned if buffer length is
47  insufficient to store the normalized string.
48 */
49 size_t normalize_string(const CHARSET_INFO *cs, const String_type &src,
50  char *normalized_str_buf,
51  size_t normalized_str_buf_length);
52 
53 ///////////////////////////////////////////////////////////////////////////
54 
55 } // namespace dd
56 
57 #endif
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
size_t normalize_string(const CHARSET_INFO *cs, const String_type &src, char *normalized_str_buf, size_t normalized_str_buf_length)
Normalize (or transform) the multibyte character set string.
Definition: dd_utility.cc:31
Definition: m_ctype.h:359
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39