|
Blender V4.3
|
A dynamically sized string ADT. More...
Go to the source code of this file.
Typedefs | |
| typedef struct DynStr | DynStr |
Functions | |
| DynStr * | BLI_dynstr_new (void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT |
| DynStr * | BLI_dynstr_new_memarena (void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT |
| void | BLI_dynstr_append (DynStr *__restrict ds, const char *cstr) ATTR_NONNULL() |
| void | BLI_dynstr_nappend (DynStr *__restrict ds, const char *cstr, int len) ATTR_NONNULL() |
| void | BLI_dynstr_appendf (DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2 |
| void | ATTR_NONNULL (1, 2) |
| void | BLI_dynstr_vappendf (DynStr *__restrict ds, const char *__restrict format, va_list args) ATTR_PRINTF_FORMAT(2 |
| int | BLI_dynstr_get_len (const DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| char * | BLI_dynstr_get_cstring (const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| void | BLI_dynstr_get_cstring_ex (const DynStr *__restrict ds, char *__restrict rets) ATTR_NONNULL() |
| void | BLI_dynstr_clear (DynStr *ds) ATTR_NONNULL() |
| void | BLI_dynstr_free (DynStr *ds) ATTR_NONNULL() |
A dynamically sized string ADT.
This ADT is designed purely for dynamic string creation through appending, not for general usage, the intent is to build up dynamic strings using a DynStr object, then convert it to a c-string and work with that.
Definition in file BLI_dynstr.h.
| typedef struct DynStr DynStr |
The abstract DynStr type.
Definition at line 28 of file BLI_dynstr.h.
| ATTR_WARN_UNUSED_RESULT ATTR_NONNULL | ( | 1 | , |
| 2 | ) |
Given a edge and one of its vertices, returns the other vertex.
Tests whether one loop is next to another within the same face.
| void BLI_dynstr_append | ( | DynStr *__restrict | ds, |
| const char * | cstr ) |
Append a c-string to a DynStr.
| ds | The DynStr to append to. |
| cstr | The c-string to append. |
Definition at line 62 of file BLI_dynstr.c.
References dynstr_alloc(), DynStrElem::next, NULL, and DynStrElem::str.
Referenced by BKE_cryptomatte_entries_to_matte_id(), BKE_mesh_debug_info(), BLI_dynstr_appendf(), BLI_dynstr_vappendf(), BLI_string_replaceN(), BM_mesh_debug_info(), console_select_to_buffer(), blender::gpu::create_key(), get_rna_access(), Matrix_str(), menu_items_from_ui_create(), blender::gpu::Shader::print_log(), report_copy_exec(), RNA_path_append(), rna_path_rename_fix(), RNA_struct_available_or_report(), ui_layout_introspect_items(), Vector_str(), and wm_platform_support_create_link().
| void BLI_dynstr_appendf | ( | DynStr *__restrict | ds, |
| const char *__restrict | format, | ||
| ... ) |
Append a c-string to a DynStr, but with formatting like printf.
| ds | The DynStr to append to. |
| format | The printf format string to use. |
Referenced by BKE_cryptomatte_entries_to_matte_id(), BKE_mesh_debug_info(), BKE_reports_string(), BM_mesh_debug_info(), bmp_slots_as_args(), Color_str(), blender::gpu::create_gpu_name(), blender::gpu::create_key(), CustomData_debug_info_from_layers(), Euler_str(), blender::animrig::get_keyframe_values_create_reports(), Matrix_str(), menu_items_from_ui_create(), blender::gpu::Shader::print_log(), pyrna_enum_repr(), pyrna_func_call(), Quaternion_str(), rna_idp_path_create(), RNA_struct_available_or_report(), ui_layout_introspect_button(), and Vector_str().
| void BLI_dynstr_clear | ( | DynStr * | ds | ) |
Clear the DynStr
| ds | The DynStr to clear. |
Definition at line 156 of file BLI_dynstr.c.
References BLI_memarena_clear(), DynStr::curlen, DynStr::elems, free(), DynStr::last, DynStr::memarena, DynStrElem::next, and NULL.
Referenced by BLI_dynstr_free(), and menu_items_from_ui_create().
| void BLI_dynstr_free | ( | DynStr * | ds | ) |
Free the DynStr
| ds | The DynStr to free. |
Definition at line 174 of file BLI_dynstr.c.
References BLI_dynstr_clear(), BLI_memarena_free(), MEM_freeN(), and DynStr::memarena.
Referenced by BKE_cryptomatte_entries_to_matte_id(), BKE_mesh_debug_info(), BKE_reports_string(), BLI_string_replaceN(), BM_mesh_debug_info(), bmp_slots_as_args(), console_select_to_buffer(), blender::gpu::create_gpu_name(), blender::gpu::create_key(), blender::animrig::get_keyframe_values_create_reports(), get_rna_access(), IDP_reprN(), main_args_help_as_string(), mathutils_dynstr_to_py(), menu_items_from_ui_create(), blender::gpu::Shader::print_log(), pyrna_enum_repr(), pyrna_func_call(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_struct_available_or_report(), studiolight_write_solid_light(), UI_layout_introspect(), and wm_platform_support_create_link().
| char * BLI_dynstr_get_cstring | ( | const DynStr * | ds | ) |
Get a DynStr's contents as a c-string.
| ds | The DynStr of interest. |
Definition at line 149 of file BLI_dynstr.c.
References BLI_dynstr_get_cstring_ex(), DynStr::curlen, and MEM_mallocN.
Referenced by BKE_cryptomatte_entries_to_matte_id(), BKE_mesh_debug_info(), BKE_reports_string(), BLI_string_replaceN(), BM_mesh_debug_info(), bmp_slots_as_args(), console_select_to_buffer(), blender::gpu::create_gpu_name(), blender::gpu::create_key(), blender::animrig::get_keyframe_values_create_reports(), get_rna_access(), IDP_reprN(), main_args_help_as_string(), blender::gpu::Shader::print_log(), pyrna_enum_repr(), pyrna_func_call(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_struct_available_or_report(), studiolight_write_solid_light(), and UI_layout_introspect().
| void BLI_dynstr_get_cstring_ex | ( | const DynStr *__restrict | ds, |
| char *__restrict | rets ) |
Get a DynStr's contents as a c-string. The rets argument must be allocated to be at least the size of BLI_dynstr_get_len(ds) + 1.
| ds | The DynStr of interest. |
| rets | The string to fill. |
Definition at line 133 of file BLI_dynstr.c.
References BLI_assert, DynStrElem::next, and DynStrElem::str.
Referenced by BLI_dynstr_get_cstring(), mathutils_dynstr_to_py(), strdup_memarena_from_dynstr(), and wm_platform_support_create_link().
Find the length of a DynStr.
| ds | The DynStr of interest. |
Definition at line 128 of file BLI_dynstr.c.
References DynStr::curlen.
Referenced by BKE_reports_string(), console_select_to_buffer(), IDP_reprN(), mathutils_dynstr_to_py(), menu_items_from_ui_create(), strdup_memarena_from_dynstr(), studiolight_write_solid_light(), and wm_platform_support_create_link().
Append a length clamped c-string to a DynStr.
| ds | The DynStr to append to. |
| cstr | The c-string to append. |
| len | The maximum length of the c-string to copy. |
Definition at line 81 of file BLI_dynstr.c.
References BLI_strnlen(), dynstr_alloc(), len, DynStrElem::next, NULL, and DynStrElem::str.
Referenced by BKE_cryptomatte_entries_to_matte_id(), BLI_string_replaceN(), console_select_to_buffer(), menu_items_from_ui_create(), blender::gpu::Shader::print_log(), repr_str(), and rna_path_rename_fix().
| DynStr * BLI_dynstr_new | ( | void | ) |
Create a new DynStr.
Definition at line 37 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, DynStr::last, MEM_mallocN, DynStr::memarena, and NULL.
Referenced by BKE_cryptomatte_entries_to_matte_id(), BKE_mesh_debug_info(), BKE_reports_string(), BLI_string_replaceN(), BM_mesh_debug_info(), bmp_slots_as_args(), Color_str(), console_select_to_buffer(), blender::gpu::create_gpu_name(), blender::gpu::create_key(), Euler_str(), blender::animrig::get_keyframe_values_create_reports(), get_rna_access(), IDP_reprN(), main_args_help_as_string(), Matrix_str(), blender::gpu::Shader::print_log(), pyrna_enum_repr(), pyrna_func_call(), Quaternion_str(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_struct_available_or_report(), studiolight_write_solid_light(), UI_layout_introspect(), Vector_str(), and wm_platform_support_create_link().
| DynStr * BLI_dynstr_new_memarena | ( | void | ) |
Create a new DynStr.
Definition at line 47 of file BLI_dynstr.c.
References BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, DynStr::curlen, DynStr::elems, DynStr::last, MEM_mallocN, DynStr::memarena, and NULL.
Referenced by menu_items_from_ui_create().
| void BLI_dynstr_vappendf | ( | DynStr *__restrict | ds, |
| const char *__restrict | format, | ||
| va_list | args ) |
Referenced by help_print_ds_fn().