Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions

Classes

struct  _wmem_strbuf_t
 

Macros

#define wmem_strbuf_create(allocator)    wmem_strbuf_new(allocator, "")
 
#define wmem_strbuf_append_unichar_repl(buf)    wmem_strbuf_append_unichar(buf, UNICODE_REPLACEMENT_CHARACTER)
 

Typedefs

typedef struct _wmem_strbuf_t wmem_strbuf_t
 

Functions

WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new_sized (wmem_allocator_t *allocator, size_t alloc_size) G_GNUC_MALLOC
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new (wmem_allocator_t *allocator, const char *str) G_GNUC_MALLOC
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new_len (wmem_allocator_t *allocator, const char *str, size_t len) G_GNUC_MALLOC
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_dup (wmem_allocator_t *allocator, const wmem_strbuf_t *strbuf) G_GNUC_MALLOC
 
WS_DLL_PUBLIC void wmem_strbuf_append (wmem_strbuf_t *strbuf, const char *str)
 
WS_DLL_PUBLIC void wmem_strbuf_append_len (wmem_strbuf_t *strbuf, const char *str, size_t append_len)
 
WS_DLL_PUBLIC void wmem_strbuf_append_printf (wmem_strbuf_t *strbuf, const char *format,...) G_GNUC_PRINTF(2
 
WS_DLL_PUBLIC void WS_DLL_PUBLIC void wmem_strbuf_append_vprintf (wmem_strbuf_t *strbuf, const char *fmt, va_list ap)
 
WS_DLL_PUBLIC void wmem_strbuf_append_c (wmem_strbuf_t *strbuf, const char c)
 
WS_DLL_PUBLIC void wmem_strbuf_append_c_count (wmem_strbuf_t *strbuf, const char c, size_t count)
 
WS_DLL_PUBLIC void wmem_strbuf_append_unichar (wmem_strbuf_t *strbuf, const gunichar c)
 
WS_DLL_PUBLIC void wmem_strbuf_append_unichar_validated (wmem_strbuf_t *strbuf, const gunichar c)
 
WS_DLL_PUBLIC void wmem_strbuf_append_hex (wmem_strbuf_t *strbuf, uint8_t)
 
WS_DLL_PUBLIC size_t wmem_strbuf_append_hex_unichar (wmem_strbuf_t *strbuf, gunichar)
 
WS_DLL_PUBLIC void wmem_strbuf_truncate (wmem_strbuf_t *strbuf, const size_t len)
 
WS_DLL_PUBLIC const char * wmem_strbuf_get_str (const wmem_strbuf_t *strbuf)
 
WS_DLL_PUBLIC size_t wmem_strbuf_get_len (const wmem_strbuf_t *strbuf)
 
WS_DLL_PUBLIC int wmem_strbuf_strcmp (const wmem_strbuf_t *sb1, const wmem_strbuf_t *sb2)
 
WS_DLL_PUBLIC const char * wmem_strbuf_strstr (const wmem_strbuf_t *haystack, const wmem_strbuf_t *needle)
 
WS_DLL_PUBLIC char * wmem_strbuf_finalize (wmem_strbuf_t *strbuf)
 
WS_DLL_PUBLIC void wmem_strbuf_destroy (wmem_strbuf_t *strbuf)
 
WS_DLL_PUBLIC bool wmem_strbuf_utf8_validate (wmem_strbuf_t *strbuf, const char **endptr)
 
WS_DLL_PUBLIC void wmem_strbuf_utf8_make_valid (wmem_strbuf_t *strbuf)
 

Detailed Description

A string object implementation on top of wmem.

Function Documentation

◆ wmem_strbuf_finalize()

WS_DLL_PUBLIC char * wmem_strbuf_finalize ( wmem_strbuf_t strbuf)

Truncates the allocated memory down to the minimal amount, frees the header structure, and returns a non-const pointer to the raw string. The wmem_strbuf_t structure cannot be used after this is called. Basically a destructor for when you still need the underlying C-string.