Blender V2.61 - r43446
|
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_get_cstring_ex (DynStr *ds, char *str) |
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 46 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 80 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, DynStr::last, DynStrElem::next, NULL, DynStrElem::str, and strlen().
Referenced by BKE_reports_prepend(), BKE_reports_prependf(), BKE_undo_menu_string(), BLI_dynstr_appendf(), 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(), console_copy_exec(), get_rna_access(), GPU_code_generate_glsl_lib(), IDnames_to_dyn_pupstring(), IDnames_to_pupstring(), IMAnames_to_pupstring(), Matrix_str(), 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(), Vector_str(), 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 168 of file BLI_dynstr.c.
References BLI_dynstr_append(), len(), MEM_callocN(), MEM_freeN(), and NULL.
Referenced by BKE_reports_string(), BPy_enum_as_string(), code_generate_vertex(), codegen_call_functions(), codegen_convert_datatype(), codegen_declare_tmps(), codegen_print_datatype(), codegen_print_uniforms_functions(), Color_str(), Euler_str(), Matrix_str(), pyrna_func_call(), Quaternion_str(), rna_idp_path_create(), RNA_pointer_as_string(), RNA_property_as_string(), ui_def_but_rna(), ui_intro_button(), uiPupMenuReports(), Vector_str(), and WM_operator_pystring().
void BLI_dynstr_free | ( | DynStr * | ds | ) |
Free the DynStr
ds | The DynStr to free. |
Definition at line 251 of file BLI_dynstr.c.
References DynStr::elems, addon::engine::free(), 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(), console_copy_exec(), get_rna_access(), GPU_code_generate_glsl_lib(), IDnames_to_pupstring(), IMAnames_to_pupstring(), mathutils_dynstr_to_py(), 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 244 of file BLI_dynstr.c.
References BLI_dynstr_get_cstring_ex(), DynStr::curlen, and MEM_mallocN().
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(), console_copy_exec(), get_rna_access(), GPU_code_generate_glsl_lib(), 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_get_cstring_ex | ( | DynStr * | ds, |
char * | str | ||
) |
Get a DynStr's contents as a c-string. The str argument must be allocated to be at least the size of BLI_dynstr_get_len(ds) + 1.
ds | The DynStr of interest. |
str | The string to fill. |
Definition at line 229 of file BLI_dynstr.c.
References DynStr::curlen, DynStr::elems, DynStrElem::next, DynStrElem::str, and strlen().
Referenced by BLI_dynstr_get_cstring(), and mathutils_dynstr_to_py().
int BLI_dynstr_get_len | ( | DynStr * | ds | ) |
Find the length of a DynStr.
ds | The DynStr of interest. |
Definition at line 224 of file BLI_dynstr.c.
References DynStr::curlen.
Referenced by BKE_reportf(), BKE_reports_prepend(), BKE_reports_prependf(), BKE_reports_string(), console_copy_exec(), IDnames_to_pupstring(), IMAnames_to_pupstring(), and mathutils_dynstr_to_py().
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 console_copy_exec().
DynStr* BLI_dynstr_new | ( | void | ) |
Create a new DynStr.
Definition at line 71 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(), Color_str(), console_copy_exec(), Euler_str(), get_rna_access(), GPU_code_generate_glsl_lib(), IDnames_to_pupstring(), IMAnames_to_pupstring(), Matrix_str(), pyrna_func_call(), Quaternion_str(), 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(), Vector_str(), and WM_operator_pystring().
void BLI_dynstr_vappendf | ( | DynStr * | ds, |
const char * | format, | ||
va_list | args | ||
) |
Definition at line 115 of file BLI_dynstr.c.
References BLI_dynstr_append(), len(), MEM_callocN(), MEM_freeN(), NULL, and va_copy.
Referenced by BKE_reportf(), BKE_reports_prependf(), and BLI_sprintfN().