Lines Matching refs:str_len
47 void mp_str_print_quoted(const mp_print_t *print, const byte *str_data, size_t str_len, bool is_byt… in mp_str_print_quoted() argument
51 for (const byte *s = str_data, *top = str_data + str_len; !has_double_quote && s < top; s++) { in mp_str_print_quoted()
63 for (const byte *s = str_data, *top = str_data + str_len; s < top; s++) { in mp_str_print_quoted()
87 void mp_str_print_json(const mp_print_t *print, const byte *str_data, size_t str_len) { in mp_str_print_json() argument
91 for (const byte *s = str_data, *top = str_data + str_len; s < top; s++) { in mp_str_print_json()
113 GET_STR_DATA_LEN(self_in, str_data, str_len); in str_print()
116 mp_str_print_json(print, str_data, str_len); in str_print()
126 print->print_strn(print->data, (const char *)str_data, str_len); in str_print()
131 mp_str_print_quoted(print, str_data, str_len, is_bytes); in str_print()
159 GET_STR_DATA_LEN(args[0], str_data, str_len); in mp_obj_str_make_new()
162 str_hash = qstr_compute_hash(str_data, str_len); in mp_obj_str_make_new()
165 if (!utf8_check(str_data, str_len)) { in mp_obj_str_make_new()
171 qstr q = qstr_find_strn((const char *)str_data, str_len); in mp_obj_str_make_new()
176 mp_obj_str_t *o = MP_OBJ_TO_PTR(mp_obj_new_str_copy(type, NULL, str_len)); in mp_obj_str_make_new()
216 GET_STR_DATA_LEN(args[0], str_data, str_len); in bytes_make_new()
219 str_hash = qstr_compute_hash(str_data, str_len); in bytes_make_new()
221 mp_obj_str_t *o = MP_OBJ_TO_PTR(mp_obj_new_str_copy(&mp_type_bytes, NULL, str_len)); in bytes_make_new()
765 GET_STR_DATA_LEN(args[0], str, str_len); in str_startswith()
770 start = str_index_to_ptr(self_type, str, str_len, args[2], true); in str_startswith()
772 if (prefix_len + (start - str) > str_len) { in str_startswith()
780 GET_STR_DATA_LEN(args[0], str, str_len); in str_endswith()
787 if (suffix_len > str_len) { in str_endswith()
790 return mp_obj_new_bool(memcmp(str + (str_len - suffix_len), suffix, suffix_len) == 0); in str_endswith()
884 GET_STR_DATA_LEN(str_in, str, str_len); in str_center()
886 if (str_len >= width) { in str_center()
893 int left = (width - str_len) / 2; in str_center()
894 memcpy(vstr.buf + left, str, str_len); in str_center()
1646 GET_STR_DATA_LEN(args[0], str, str_len); in str_replace()
1651 if (old_len > str_len) { in str_replace()
1667 size_t str_len_remain = str_len; in str_replace()
1692 str_len_remain = str + str_len - offset_ptr; in str_replace()
1774 GET_STR_DATA_LEN(self_in, str, str_len); in str_partitioner()
1798 const byte *position_ptr = find_subbytes(str, str_len, sep, sep_len, direction); in str_partitioner()
1803 …result[2] = mp_obj_new_str_of_type(self_type, str + position + sep_len, str_len - position - sep_l… in str_partitioner()
1932 GET_STR_DATA_LEN(self_in, str_data, str_len); in mp_obj_str_get_buffer()
1934 bufinfo->len = str_len; in mp_obj_str_get_buffer()