|
Blender
V2.59
|
A dynamically sized string ADT. More...
#include <stdarg.h>Go to the source code of this file.
Typedefs | |
| typedef struct DynStr | DynStr |
Functions | |
| DynStr * | BLI_dynstr_new (void) |
| void | BLI_dynstr_append (DynStr *ds, const char *cstr) |
| void | BLI_dynstr_nappend (DynStr *ds, const char *cstr, int len) |
| void | BLI_dynstr_appendf (DynStr *ds, const char *format,...) |
| void | BLI_dynstr_vappendf (DynStr *ds, const char *format, va_list args) |
| int | BLI_dynstr_get_len (DynStr *ds) |
| char * | BLI_dynstr_get_cstring (DynStr *ds) |
| void | BLI_dynstr_free (DynStr *ds) |
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.
The abstract DynStr type
Definition at line 48 of file BLI_dynstr.h.
| void BLI_dynstr_append | ( | DynStr * | 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 81 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, DynStr::last, DynStrElem::next, NULL, and DynStrElem::str.
Referenced by BKE_reports_prepend(), BKE_reports_prependf(), BKE_undo_menu_string(), BLI_dynstr_appendf(), BLI_dynstr_printf(), BLI_dynstr_vappendf(), BLI_replacestr(), code_generate_fragment(), code_generate_vertex(), codegen_call_functions(), codegen_convert_datatype(), codegen_declare_tmps(), codegen_print_datatype(), codegen_print_uniforms_functions(), copy_exec(), get_rna_access(), IDnames_to_dyn_pupstring(), IDnames_to_pupstring(), IMAnames_to_pupstring(), report_copy_exec(), RNA_path_append(), rna_path_rename_fix(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), ui_intro_items(), and WM_operator_pystring().
| void BLI_dynstr_appendf | ( | DynStr * | ds, |
| const char * | 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. |
Definition at line 167 of file BLI_dynstr.c.
References BLI_dynstr_append(), MEM_callocN(), MEM_freeN(), and NULL.
Referenced by BKE_reports_string(), BPy_enum_as_string(), pyrna_func_call(), rna_idp_path_create(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), ui_intro_button(), uiPupMenuReports(), and WM_operator_pystring().
| void BLI_dynstr_free | ( | DynStr * | ds | ) |
Free the DynStr
| ds | The DynStr to free. |
Definition at line 243 of file BLI_dynstr.c.
References DynStr::elems, MEM_freeN(), DynStrElem::next, and DynStrElem::str.
Referenced by BKE_reportf(), BKE_reports_prepend(), BKE_reports_prependf(), BKE_reports_string(), BKE_undo_menu_string(), BLI_replacestr(), BLI_sprintfN(), BPy_enum_as_string(), code_generate_fragment(), code_generate_vertex(), copy_exec(), get_rna_access(), IDnames_to_pupstring(), IMAnames_to_pupstring(), pyrna_func_call(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), uiLayoutIntrospect(), uiPupMenuReports(), and WM_operator_pystring().
| char* BLI_dynstr_get_cstring | ( | DynStr * | ds | ) |
Get a DynStr's contents as a c-string. The returned c-string should be free'd using MEM_freeN.
| ds | The DynStr of interest. |
Definition at line 227 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, MEM_mallocN(), DynStrElem::next, and DynStrElem::str.
Referenced by BKE_reportf(), BKE_reports_prepend(), BKE_reports_prependf(), BKE_reports_string(), BKE_undo_menu_string(), BLI_replacestr(), BLI_sprintfN(), BPy_enum_as_string(), code_generate_fragment(), code_generate_vertex(), copy_exec(), get_rna_access(), IDnames_to_pupstring(), IMAnames_to_pupstring(), pyrna_func_call(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), uiLayoutIntrospect(), uiPupMenuReports(), and WM_operator_pystring().
| int BLI_dynstr_get_len | ( | DynStr * | ds | ) |
Find the length of a DynStr.
| ds | The DynStr of interest. |
Definition at line 223 of file BLI_dynstr.c.
References DynStr::curlen.
Referenced by BKE_reportf(), BKE_reports_prepend(), BKE_reports_prependf(), BKE_reports_string(), copy_exec(), IDnames_to_pupstring(), and IMAnames_to_pupstring().
| void BLI_dynstr_nappend | ( | DynStr * | ds, |
| const char * | cstr, | ||
| int | len | ||
| ) |
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 97 of file BLI_dynstr.c.
References BLI_strnlen(), DynStr::curlen, DynStr::elems, DynStr::last, DynStrElem::next, NULL, and DynStrElem::str.
Referenced by copy_exec().
| DynStr* BLI_dynstr_new | ( | void | ) |
Create a new DynStr.
Definition at line 73 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, DynStr::last, MEM_mallocN(), and NULL.
Referenced by BKE_reportf(), BKE_reports_prepend(), BKE_reports_prependf(), BKE_reports_string(), BKE_undo_menu_string(), BLI_replacestr(), BLI_sprintfN(), BPy_enum_as_string(), code_generate_fragment(), code_generate_vertex(), copy_exec(), get_rna_access(), IDnames_to_pupstring(), IMAnames_to_pupstring(), pyrna_func_call(), report_copy_exec(), rna_idp_path_create(), RNA_path_append(), rna_path_rename_fix(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), uiLayoutIntrospect(), uiPupMenuReports(), and WM_operator_pystring().
| void BLI_dynstr_vappendf | ( | DynStr * | ds, |
| const char * | format, | ||
| va_list | args | ||
| ) |
Definition at line 114 of file BLI_dynstr.c.
References BLI_dynstr_append(), MEM_callocN(), MEM_freeN(), NULL, and va_copy.
Referenced by BKE_reportf(), BKE_reports_prependf(), and BLI_sprintfN().