MCPcopy Create free account
hub / github.com/MariaDB/server / String_copier

Class String_copier

sql/sql_string.h:58–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58class String_copier: public String_copy_status,
59 protected MY_STRCONV_STATUS
60{
61public:
62 const char *cannot_convert_error_pos() const
63 { return m_cannot_convert_error_pos; }
64 const char *most_important_error_pos() const
65 {
66 return well_formed_error_pos() ? well_formed_error_pos() :
67 cannot_convert_error_pos();
68 }
69 /*
70 Convert a string between character sets.
71 "dstcs" and "srccs" cannot be &my_charset_bin.
72 */
73 size_t convert_fix(CHARSET_INFO *dstcs, char *dst, size_t dst_length,
74 CHARSET_INFO *srccs, const char *src, size_t src_length,
75 size_t nchars)
76 {
77 return my_convert_fix(dstcs, dst, dst_length,
78 srccs, src, src_length, nchars, this, this);
79 }
80 /*
81 Copy a string. Fix bad bytes/characters to '?'.
82 */
83 uint well_formed_copy(CHARSET_INFO *to_cs, char *to, size_t to_length,
84 CHARSET_INFO *from_cs, const char *from,
85 size_t from_length, size_t nchars);
86 // Same as above, but without the "nchars" limit.
87 uint well_formed_copy(CHARSET_INFO *to_cs, char *to, size_t to_length,
88 CHARSET_INFO *from_cs, const char *from,
89 size_t from_length)
90 {
91 return well_formed_copy(to_cs, to, to_length,
92 from_cs, from, from_length,
93 from_length /* No limit on "nchars"*/);
94 }
95};
96
97
98size_t my_copy_with_hex_escaping(CHARSET_INFO *cs,

Callers 1

assign_fixed_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected